POST tailored_audience_memberships AND GOT ERROR

api

#1

Hi

https://ads-api.twitter.com/1/tailored_audience_memberships

I made a request to the above URL but an error will be returned.

– REQUEST
twurl -X POST -H ads-api.twitter.com --header ‘Content-Type: application/json’ --data ‘[{“operation_type”:“Update”,“params”:{“membership_type”:“LIST_MEMBERSHIP”,“advertiser_account_id”:“ACCOUNT_ID”,“user_identifier”:“4aeebe7c85c1ca7d7dc6a68b3963354249ed7c19c100e4791e1948ce8eb7d9c2”,“user_identifier_type”:“DEVICE_ID”,“audience_names”:“TestDeviceList”,“effective_at”:“2017-04-13T03:58:22Z”,“expires_at”,“2017-04-23T03:58:22Z”}}]’ “/1/tailored_audience_memberships”

– ERROR
-> “HTTP/1.1 400 Bad Request\r\n”
-> “connection: close\r\n”
-> “content-disposition: attachment; filename=json.json\r\n”
-> “content-encoding: gzip\r\n”
-> “content-length: 126\r\n”
-> “content-type: application/json;charset=utf-8\r\n”
-> “date: Thu, 13 Apr 2017 08:35:35 GMT\r\n”
-> “server: tsa_m\r\n”
-> “set-cookie: guest_id=v1%3A149207253558156916; Domain=.twitter.com; Path=/; Expires=Sat, 13-Apr-2019 08:35:35 UTC\r\n”
-> “strict-transport-security: max-age=631138519\r\n”
-> “x-connection-hash: 06664ebf1b72663d287716e31c690662\r\n”
-> “x-content-type-options: nosniff\r\n”
-> “x-frame-options: SAMEORIGIN\r\n”
-> “x-rate-limit-limit: 6000\r\n”
-> “x-rate-limit-remaining: 6000\r\n”
-> “x-rate-limit-reset: 1492072595\r\n”
-> “x-response-time: 111\r\n”
-> “x-transaction: 00aa16eb0053725f\r\n”
-> “x-tsa-request-body-time: 1\r\n”
-> “x-xss-protection: 1; mode=block\r\n”
-> “\r\n”
{“errors”:[{“code”:“INVALID”,“message”:“The JSON string format is invalid”}],“operation_errors”:[],“request”:[]}

App ID: 13444238

Sorry to trouble you, but please confirm.

Thank you.


#2

Hi - can you please check the thread Real-Time Audience API endpoint gives invalid format exception and see if the advice there solves the issue for you?