You are not logged in.
Hi, I have been trying to update/create some values of a form (a tab in Ticket Entity) generated by fieldsPlugin but the values won't change.
Note that ${} represents a ficticious value.
I'm doing this type of request:
curl -X PUT -H 'Content-Type: application/json' -H "Session-Token: ${$mySessionToken}" -H "App-Token: ${myAppToken}" -d '{"input": {"PluginFieldsTicket${TabName}": {"${name}field": "Bla", "${number}field": "1"}}}' 'http://${serverName}/apirest.php/Ticket/${ticketId}/'
and it returns:
[{"${ticketId}":true,"message":""}]
however the field's values are not being updated, am I doing anything wrong?
If so, please give me any sugestion!
Offline
The problem has been solved!
Note that ${} represents a ficticious value and $[] represents any mandatory data to your plugin entity generation.
In order to make a Post request to your custom form you should do this:
curl -X POST -H 'Content-Type: application/json' -H "Session-Token: ${$mySessionToken}" -H "App-Token: ${myAppToken}" -d '{"input": $[{"${fakeMandatoryKey1}": "${fakeMandatoryValue1}", ...], "plugin_fields_containers_id": "${containerId}", "items_id": "${ticketId}"}}' 'http://${serverName}/apirest.php/PluginFieldsTicket${TabName}'
and you'll get this:
{"id":${pluginFieldTicketId},"message":"Item successfully added: General - ID ${pluginFieldTicketId} (${pluginFieldTicketId})"}
the same applyies to your Put request, you just need to add the pluginFieldTicketId to the URL just like a base Entity:
curl -X PUT -H 'Content-Type: application/json' -H "Session-Token: ${$mySessionToken}" -H "App-Token: ${myAppToken}" -d '{"input": $[{"${fakeMandatoryKey1}": "${fakeMandatoryValue1}", ...], "plugin_fields_containers_id": "${containerId}", "items_id": "${ticketId}"}}' 'http://${serverName}/apirest.php/PluginFieldsTicket${TabName}/${pluginFieldTicketId}'
you'll get something like this:
[{"${pluginFieldTicketId}":true,"message":""}]
Offline