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:
<GetCampaignsByIdsRequest
xmlns="http://schemas.datacontract.org/2004/07/HostedService.CampaignManagementService.Rest"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<CampaignIds
xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:long></d4p1:long>
</CampaignIds>
</GetCampaignsByIdsRequest>
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:
https://adcenterapi.microsoft.com/Api/Advertiser/v7/CampaignManagement/CampaignManagementServiceREST.svc/customer/account/NNNNNN/campaign?$field=ids&format=json
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?
Thanks!
j