Getting a “400 Bad Request” when trying to create a deal


#1

Hi i am trying to create a deal in hubspot using deal api , i am getting the following error(The remote server returned an error: (400) Bad Request.)

string strJsonData = "{" +
" "associations": {" +
" "associatedCompanyIds": [" +
"2905584" +
" ]," +
""associatedVids": [" +
"25992901" +
" ]" +
" }," +
" "properties": [" +
" {" +
" "value": "varadantestdeal"," +
" "name": "dealname"" +
" }," +
" {" +
" "value": "Customer made an inquiry"," +
" "name": "dealstage"" +
" }" +
" {" +
" "value": "Sales Pipeline"," +
" "name": "pipeline"" +
" }" +
" ]" +
"}";


#2

Hi @varadan,

Are you including the Content-type header? It must be explicitly included and set to application/json.


#3

Hi Derek_Gervais,

              Thanks for your reply , I did not give the internal value of the properties instead of that i gave the name of the property in the json, So only i got the 400 Bad Request, now i can able to create deal.