API error with account id

I’m getting an error that says AccountId is missing, but I included it in my call. Anyone know what I’m doing wrong?

API documentation Swagger UI

I’m able to recreate the error by removing everything inside payload on apicontrolcenter.

See below image of my setup.

JSON BODY CONTENT

{
  "accountId": <Account ID>,
  "subscription": {
    "subscriberAccount": <Subscriber Account>,
    "productId": <Product ID>,
    "startTime": "2019-06-03"
  }
}

You need AccountId and not accountID (caps A)

1 Like

That’s also what I thought. I did that but it gave me the same error.

I think that you also need ot but the between " " because I think it’s a string and not integer
i suggest you to try changing a moment the url to a Request bin. Do the call and check exactly what is sent. This can help a lot debugging (and you can parse the json sent to jsonlint to check for any error)

Yes it’s defined as a string.

I mean that your token for Account ID is a string and need to be put into " "
{
“accountId”:"".


According to this page, this is accountId and no A (but the message error say A… )

Also, I see that the Content type header is not always included in call from Bubble. Add it to header

1 Like

Issue solved. I forgot to add a content-type to my header as application/json.

Also the JSON code was incorrect and had to be defined as a string.

{
  "accountId": "<AccountId>",
  "subscription": {
    "subscriberAccount": "<Subscriber Account>",
    "productId": "<productId>",
    "startTime": "<start Time>"
  }
}
1 Like