Use API to Retrieve Satisfaction URLs
4me’s REST API for requests has been extended. It now offers the ability to retrieve a set of URLs for each completed request. This set of URLs allows requesters to indicate whether or not they are satisfied with the way their request has been handled.
These URLs are similar to the ones used in the request template ‘Request Set to Completed’. Making it possible to generate these URLs with the REST API makes it possible for service provider organizations to, for example, have a custom script send out a reminder email to the requester after a request has been completed for more than 2 days and its Satisfaction field is still blank.
Example of an API call that returns the satisfied and dissatisfied URLs:
curl -u “[email protected]:4me” -H “X-4me-Account: widget-hr” “https://api.4me.com/v1/requests/70383”
Response:
…”feedback”:{“requested_by”:{“satisfied_url”:”https://widget.4me.com/requests/70383/e1pbqtbf/313/yes”,
“dissatisfied_url”:”https://widget.4me.com/requests/70383/e1pbqtbf/313/no”…
Example of an API call where the requested_by and the requested_for person are different:
curl -u “[email protected]:4me” -H “X-4me-Account: widget-hr” “https://api.4me.com/v1/requests/70248”
Response:
…”feedback”:{“requested_by”:{“satisfied_url”:”https://widget.4me.com/requests/70248/2sii015q/149/yes”,
“dissatisfied_url”:”https://widget.4me.com/requests/70248/2sii015q/149/no”},
“requested_for”:{“satisfied_url”:”https://widget.4me.com/requests/70248/2sii015q/187/yes”,
“dissatisfied_url”:”https://widget.4me.com/requests/70248/2sii015q/187/no”…
Example of an API call for retrieving all feedback URLs, where the last 3 requests are not yet completed:
curl -u “[email protected]:4me” -H “X-4me-Account: widget-hr” “https://api.4me.com/v1/requests?fields=id,feedback”
Response:
[{“id”:70475,”feedback”:null},{“id”:70474,”feedback”:{“requested_by”:{“satisfied_url”:”https://widget.4me.com/requests/70474/39ygzsoh/8/yes”,
“dissatisfied_url”:”https://widget.4me.com/requests/70474/39ygzsoh/8/no”}}},{“id”:70473,”feedback”:{“requested_by”:{“satisfied_url”:”https://widget.4me.com/requests/70473/3gon74kj/399/yes”,
“dissatisfied_url”:”https://widget.4me.com/requests/70473/3gon74kj/399/no”}}},
… ,
{“id”:70438,”feedback”:null},
{“id”:70437,”feedback”:null},
{“id”:70434,”feedback”:null}]