I need to upload Device Ids to User Lists

154 views
Skip to first unread message

Sankar Piridi

unread,
May 11, 2022, 3:45:00 AM5/11/22
to Authorized Buyers API Forum
Hi Team,

Can you please help me to add Android and iOS device IDs to User Lists. Somehow I have found that we have to use Protobuf to upload the data but I don't know how to do that. Can you help me with sample codes. I use python.

Thanks 
Sankar

Mark Saniscalchi

unread,
May 11, 2022, 2:28:18 PM5/11/22
to Authorized Buyers API Forum
Hello Sankar,

While we do assist with API questions here, it is beyond our scope to offer customized support for tangentially related technologies–a comparable example is that we would not walk a user through the process of building the web server for their real-time bidding integration. As things currently stand, we haven't received a sufficient amount of feedback to prioritize the development of OSS bulk uploader samples. However, I can at least provide some guidance to get you started with this.

When using the bulk uploader service, the workflow can be summarized as follows:
  1. Use a generated Protobuf library to build a UpdateUsersDataRequest.
  2. Serialize the UpdateUsersDataRequest and include it in a request to the bulk uploader endpoint.
  3. Receive a response from the bulk uploader endpoint containing a serialized UpdateUsersDataResponse.
  4. Use the same generated Protobuf library to deserialize the UpdateUsersDataResponse and interpret its contents–e.g. determine whether the operation succeeded or failed.
I'd first recommend that you look at the Python Protocol Buffer Basics guide in order to better understand how to compile and generate a library from the cookie-bulk-upload.proto file. From there, you can look to the Bulk Uploader guide to learn details about the endpoint's URL, and how to construct / parse the UpdateUsersDataRequest / UpdateUsersDataResponse.

Regards,
Mark

Mark Saniscalchi

unread,
May 11, 2022, 2:31:24 PM5/11/22
to Authorized Buyers API Forum
I also wanted to add in case you haven't seen it yet: here is the Bulk Uploader guide.

-- Mark

Sankar Piridi

unread,
May 12, 2022, 8:51:24 AM5/12/22
to Mark Saniscalchi, Authorized Buyers API Forum
Thanks Mark, I have tried to post UpdateUsersDataRequest to https://cm.g.doubleclick.net/upload?nid=revenuemantra URL, but it is throwing 400 error. Here is the sample code

User = addressbook_pb2.UserDataOperation()
User.user_id = "2024D65F-EBBD-11FF-23AB-823FC255913A"
User.user_id_type = 2
User.user_list_id = 7216698061
data = addressbook_pb2.UpdateUsersDataRequest()
data.ops.extend([User])
data.send_notifications = 2
payload = data.SerializeToString()
url = 'https://cm.g.doubleclick.net/upload?nid=revenuemantra'
headers = {'Content-Type':'application/octet-stream'}
r = requests.post(url,data=payload,headers=headers

Thanks & Regards
P Sankar Rao


--
You received this message because you are subscribed to the Google Groups "Authorized Buyers API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-doubleclick-ad-exch...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-doubleclick-ad-exchange-buyer-api/38ba23da-0073-403c-b956-0815ad0fa492n%40googlegroups.com.


--
Thanks & Regards,
P Sankar Rao

Mark Saniscalchi

unread,
May 17, 2022, 1:51:07 PM5/17/22
to Authorized Buyers API Forum
Hello Sankar,

The HTTP 400 response usually includes some additional information in the response body–a pretty common one we see in these cases is BAD_COOKIE, for example.

Unfortunately, being a legacy API that predates our other more modernized APIs, the error messaging is not always intuitive. For example, BAD_COOKIE is known to occur for a few reasons, such as:
  • The provided ID can not be decoded
  • It is treated as a top-level error message if all IDs in the request do not have an internal mapping. For mobile Android / iOS IDs, mapping would not exist if the user associated with that ID never logged used a mobile app that records the mapping.
It looks like you're building and sending the request successfully. I would suggest trying with a wider variety of IDs and checking what (if any) error responses you're getting.

Regards,
Mark
Reply all
Reply to author
Forward
0 new messages