I have attached a functioning GET and POST API, but I don't know how to view the json arguments sent to the API.
Example:the 'value': 'something to test' string. How do I get to that value in the API?.
I have attached a functioning GET and POST API, but I don't know how to view the json arguments sent to the API.
Example:the 'value': 'something to test' string. How do I get to that value in the API?.
The result I get from the following is 'Hello World'. I don't get anything from value.
Am I missing something?
I am using the following API:
I think the problem lies in Javascript.
SugarCRM uses CRUD approach for api calls, so you should not use POST/PUT/GET etc manually. You have to use create/read/update/delete.
Eg:
app.api.call('read', ... // GET
app.api.call('create', ... // POST
app.api.call('update', ... // PUT
Anything that is not CRUD is considered GET, so your JSON is never sent to backend, which is why you didn't see the value in your API. If you change it to create, it should do a POST and you should be able to see the value in $args.
I've tried to document some common snippets and usages here, in case it helps: https://seventunes.com/sugarcrm-javascript-snippets-1/#crud
I think the problem lies in Javascript.
SugarCRM uses CRUD approach for api calls, so you should not use POST/PUT/GET etc manually. You have to use create/read/update/delete.
Eg:
app.api.call('read', ... // GET
app.api.call('create', ... // POST
app.api.call('update', ... // PUT
Anything that is not CRUD is considered GET, so your JSON is never sent to backend, which is why you didn't see the value in your API. If you change it to create, it should do a POST and you should be able to see the value in $args.
I've tried to document some common snippets and usages here, in case it helps: https://seventunes.com/sugarcrm-javascript-snippets-1/#crud