[SalesForce] Marketing Cloud API – Bad Request (400)/interaction/v1/events

I am trying to use the /interaction/v1/events API.

I have made a request to #https:#//auth.exacttargetapis.com/v1/requestToken using my clientid and clientsecret and get back a accessToken

When I try to make a request to POST #https:#//www.exacttargetapis.com/interaction/v1/events I get back a 400 Bad Request response with message

{"message":"Runtime Error. Retry this action. Contact Global Support if the issue persists","errorcode":30000,"documentation":""}

This is the request that I am trying to send

POST https://www.exacttargetapis.com/interaction/v1/events
Content-Type: application/json
Authorization: Bearer insertAccessToken
Host: www.exacttargetapis.com
Content-Length: 181

{  
   "ContactKey":"ID601",
   "EventDefinitionKey":"Cub_Competition",
   "EstablishContactKey":false,
   "Data":{  
      "FirstName":"Andy Elks",
      "EmailAddress":"subscriber@email.com",
      "Choice":"Mika"
   }
}

Why is this not working?, I have followed the documentation here https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/postEvent.htm

Thanks

Best Answer

You will get a 400 error if you include a Content-Length header.

Another issue could be that you don't have an Event with the Event Definition Key Cub_Competition. Can you confirm that this is the actual Event Definition Key? Is this the key you created when creating the API Event? Also, please confirm that the name/value pairs in your Data object match the fields in your Event Source DE.

Related Topic