Post Connections API failing

I am making a post connection API call as mentioned in the documentation
curl -X POST
https://eu2.make.com/api/v2/connections?teamId=236348
-H 'Authorization: Token
-d ‘{ “name”: “XXX”,
“accountName”: “facebook”,
“accountLabel”: “Facebook”,
“accountType”:“oauth”}’

I get a bad request message back as follows

{
“detail”: “Validation failed for 1 parameter(s).”,
“message”: “Bad Request”,
“code”: “SC400”,
“suberrors”: [{
“message”: “Missing value of required parameter ‘accountType’.”,
“name”: “Error”
}]
}

What is valid accountType?? Can somebody help?? I already tried “facebook”, “Facebook” , doesnt work

JSON parsing can be a little picky on whitespace sometimes … I note that you don’t have a space between the colon ( : ) and “oauth”, which could be the issue.

oauth is a valid accountType.

2 Likes

Thanks @DavidGurr_Make for your time to answer, I added a space, but still no luck…

Input:
curl -X POST
https://eu2.make.com/api/v2/connections?teamId=236348
-H ‘Authorization: Token xxxxxx’
-d ‘{“name” : “Deep Dive AI”, “accountName” : “facebook”, “accountLabel” : “Facebook”, “accountType” : “oauth”}’

Output:
{
“detail”: “Validation failed for 1 parameter(s).”,
“message”: “Bad Request”,
“code”: “SC400”,
“suberrors”: [{
“message”: “Missing value of required parameter ‘accountType’.”,
“name”: “Error”
}]
}

According to the documentation, there is no accountLabel parameter. There is only accountName, accountType, and scopes.

Also, if you are adding a Facebook OAuth connection, you might need to add scopes.

curl -X POST \
  'https://eu1.make.com/api/v2/connections?teamId=1' \
  -H 'Authorization: Token abcdefab-1234-5678-abcd-112233445566' \
  -d '{"accountName":"Slack Test","accountType":"slack","scopes":["chat:write"]}'

Also, the entire cURL command must be on the same line. If you want to split it into multiple lines, you have to escape the end of line with a backslash \

3 Likes