Using a JSON request in AdCenter RRS feed

  • Question

  • I can't find any example in the docs, and searching the forums resulting in nothing, so I'm posting.

    http://msdn.microsoft.com/en-us/library/ff728488.aspx says GetCampaignsByIds can use XML or JSON, but it doesn't give any examples of how to post a request using JSON.  Also, the feed at https://adcenterapi.microsoft.com/Api/Advertiser/v7/CampaignManagement/CampaignManagementServiceREST.svc/help explicitly says:

    Request Format:  XML or JSON

    Based on the XML example:


    I've tried posting a JSON request of:

    {"GetCampaignsByIdsRequest": {"CampaignIds": [NNNNNNNN, NNNNNNNN]}}

    And I've also tried just:

    {"CampaignIds": [NNNNNNNN, NNNNNNNN]}

    But I'm getting this back from the server:

    {u'Errors': [{u'ErrorCode': u'InternalError', u'Message': u'An internal error has occurred.', u'Code': 0, u'Detail': None}], u'TrackingId': u'63637dfa-4ee2-4e4c-a229-d01eb3d41652'}

    I'm using a request URL of:

    Has anyone successfully used the REST API to post a JSON request? Is there an example in the docs as to how to structure the JSON data when sending a request?


    Saturday, December 4, 2010 12:00 AM