Thank you for reaching out to us.
Sample code:
curl -X POST "
https://googleads.googleapis.com/$(version)/customers/$CustomerID)/userLists:mutate" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \
--header "developer-token: ${DEVELOPER_TOKEN}" \
--header "login-customer-id: ${LOGIN_CUSTOMER_ID}" \
--data "{
'operations': [
{
'create': {
'crmBasedUserList': {
'uploadKeyType': 'CONTACT_INFO'
},
'name': 'Customer Match list $(date)',
'description': 'A list of customers that originated from email addresses',
'membershipLifeSpan': 30
}
}
]
# Substitute ${USER_LIST_RESOURCE_NAME} with the user list resource name
# returned when creating the user list in the last step.
And then you will need to create an offlineuserdatajob to upload data:
curl -X POST "
https://googleads.googleapis.com/$(version)/customers/$CustomerID)//offlineUserDataJobs:create" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \
--header "developer-token: ${DEVELOPER_TOKEN}" \
--header "login-customer-id: ${LOGIN_CUSTOMER_ID}" \
--data "{
'job': {
'type': 'CUSTOMER_MATCH_USER_LIST',
'customerMatchUserListMetadata': {
'userList': '${USER_LIST_RESOURCE_NAME}'
}
}
}"
Lastly, you will need to use the offlineUserDataJobs.addOperations to Add operations to the offline user data job.
# Substitute ${OFFLINE_USER_DATA_JOB_ID} with the offline user data
# job ID (a long number) returned when creating the job in the last step.
# Uploads email, first name, last name, and address data to the job.
# Note: Emails, first names, and last names must be SHA-256 encoded.
curl -X POST "
https://googleads.googleapis.com/$(version)/customers/$CustomerID)/offlineUserDataJobs/${OFFLINE_USER_DATA_JOB_ID}:addOperations" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \
--header "developer-token: ${DEVELOPER_TOKEN}" \
--header "login-customer-id: ${LOGIN_CUSTOMER_ID}" \
--data "{
'operations': {
'create': {
'userIdentifiers': {
'hashedEmail': 'REDACTED'
}
}
},
'operations': {
'create': {
'userIdentifiers': {
'addressInfo': {
'hashedFirstName': 'REDACTED',
'hashedLastName': 'REDACTED',
'countryCode': 'US',
'postalCode': '10011'
}
}
}
},
'enablePartialFailure': 'true'
}"
To check your offlineuserdatajob's status, you may use the offline_user_data_job report.
Let us know if this is what you are looking for.
Links included in this email:
Regards,