Hello everyone,
On a Custom WebService DataAction Integration created via API ( based on the wizzard-app sample) we need to set the web service credentials.
in the first step the credentials (basicAuth type) are created using
postIntegrationsCredentials:
let credentials = {
"body": {
"name": "Integration-2cefbe68-cdd8-4f21-89ab-6f3036bafd3d",
"type": {
"name": "basicAuth",
"properties": {
"password": {
"type": "string",
"title": "Password",
"description": "The password used for authentication.",
"sensitive": true,
"confirm": true
},
"userName": {
"type": "string",
"title": "Username",
"description": "The username used for authentication."
}
},
"displayOrder": [
"userName",
"password"],
"required": [
"userName"]
},
"credentialFields": {
"password": "p@ssword",
"userName": "loginname"
}
}
}
postIntegrationsCredentials(credentials)
Response (CredentialInfo):
{
"id": "97f652b5-eb50-4989-9d99-9ed9d6cd5fed",
"name": "Integration-00000000-0000-0000-0000-000000000000",
"createdDate": "2019-12-17T16:16:21Z",
"modifiedDate": "2019-12-17T16:16:21Z",
"type": {
"name": "basicAuth"
},
"selfUri": "/api/v2/integrations/credentials/97f652b5-eb50-4989-9d99-9ed9d6cd5fed"
}return value (CredentialInfo) is used then via
putIntegrationConfigCurrent to update the integration.
PUT /api/v2/integrations/00000000-0000-0000-0000-000000000000/config/current HTTP/1.1
Host: api.mypurecloud.com
Content-Type: application/json
Authorization: Bearer luaDd8uS2McYHoJaxOoVFxGKoKosIFnVtn4Izt3t8txKKWgjAhWaKH1YT-Aonuj78sQJHAYGQkw6Ew--c86Ymw
User-Agent: PostmanRuntime/7.20.1
Accept: */*
Cache-Control: no-cache
Postman-Token: abe7b860-472e-4727-bea3-1b75a0c81268,b30ecb0c-45cd-4050-ac27-7cbb5757854b
Host: api.mypurecloud.com
Accept-Encoding: gzip, deflate
Content-Length: 901
Connection: keep-alive
cache-control: no-cache
{
"name": "TEST Integration with Credentials",
"version": "3",
"properties": {
"url": "https://www.test-credentials.com",
"sandbox": "allow-forms,allow-modals,allow-popups,allow-presentation,allow-same-origin,allow-scripts",
"displayType": "standalone",
"featureCategory": "",
"groupFilter": [
"1301c6da-779b-4487-843d-04572bba22d8",
"b70424e5-c699-4ccf-bb7a-48cab94fc738"
]
},
"advanced": {},
"notes": """,
"credentials": {
"id": "97f652b5-eb50-4989-9d99-9ed9d6cd5fed",
"name": "Integration-00000000-0000-0000-0000-000000000000",
"createdDate": "2019-12-17T16:16:21Z",
"modifiedDate": "2019-12-17T16:16:21Z",
"type": {
"name": "basicAuth"
},
"selfUri": "/api/v2/integrations/credentials/97f652b5-eb50-4989-9d99-9ed9d6cd5fed"
}
}
the response we get back is:
{
"status": 400,
"code": "bad.request",
"message": "The request could not be understood by the server due to malformed syntax.",
"contextId": "2c2f0b34-3e70-4ca0-86a7-3b8f3f2e858c",
"details": [],
"errors": []
}
Whats the right request format for credentials configuration ?
Note : If credentials filed is left empty the the request is successful.
Many Thanks!
Andrei
#Integrations------------------------------
LumenVox
------------------------------