I have created a new webhook and custom logic in order to match accounts in different systems. After these checks, the corresponding deal should get a new deal_stage_id, since the funnel will be completed when the logic returns true.
When an API-call is posted with CURL, in the terminal, everything works fine. However, Implemented in the server.js file, it will return a GET-response in stead of updating the record.
The code is as follows:
var body = JSON.stringify({"deal":{"deal_stage_id":30000050925}})
$request.put("https://gorillaservices6.myfreshworks.com/crm/sales/api/deals/"+deals, options, body)
.then(function(data) {
console.log(data);
},
function(error) {
console.log(error);
//handle failure
}
);
```
The header is defined above and holds the auth-token and content:application/json. These parameters work on the GET-requests