TestUser | 2020-05-17 16:42:42 UTC | #1
Hi
I'm trying to use Purecloud data action to search for a external contact,
contracts:
{ "type": "object", "properties": { "q": { "default": "20811019", "type": "string" } }, "additionalProperties": true }
configuration:
{ "requestUrlTemplate": "/api/v2/externalcontacts/contacts", "requestType": "GET", "headers": {}, "requestTemplate": "{\"q\":\"${input.q}\"}" }
Problem : though I'm passing Q value to search for particular external contact, I always gets the whole results.
validated Request body :
{ "q": "20811019", "orgId": "ef1a1644-d3f5-4ee4-b39d-4c08f4c26a3d", "integrationId": "edc58e87-06f7-4092-95be-9dbef59e8c70", "rawRequest": "{\"q\":\"20811019\"}" }
Response :
{ "entities": [ { "id": "73d19ce6-118c-4a60-831c-8ccd16e4cb53", "firstName": "15516169814", "middleName": "20873001", "lastName": "vip", "title": "", "modifyDate": "2020-05-17T16:35:11Z", "createDate": "2020-05-17T16:35:11Z", "surveyOptOut": false, "selfUri": "/api/v2/externalcontacts/contacts/73d19ce6-118c-4a60-831c-8ccd16e4cb53" } ], "pageSize": 20, "pageNumber": 1, "total": 1, "firstUri": "/api/v2/externalcontacts/contacts?pageSize=20&pageNumber=1", "selfUri": "/api/v2/externalcontacts/contacts?pageSize=20&pageNumber=1", "lastUri": "/api/v2/externalcontacts/contacts?pageSize=20&pageNumber=1", "pageCount": 1 }
I have also tried below,
{ "requestUrlTemplate": "/api/v2/externalcontacts/contacts", "requestType": "GET", "headers": {}, "requestTemplate": "${input.rawRequest}" }
Jason_Mathison | 2020-05-18 01:41:30 UTC | #2
Based on the API explorer, it looks like the q=SeachKeywords should be part of the URL, not the body:
https://developer.mypurecloud.com/openapi-explorer/index.html?openApiUrl=/swagger-schema/publicapi-v2-latest.json&host=api.mypurecloud.com&shareUrl=https://developer.mypurecloud.com%2Fdeveloper-tools%2F%23%2Fapi-explorer%3F#request0
Note that you may need to use the URL encoding tools in your URL template.
--Jason
system | 2020-06-18 01:41:30 UTC | #3
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 7814