Genesys Cloud Developer Forum

Web messaging Guest API can send structured errors

Description

When something goes wrong, Genesys Cloud currently sends errors with the following format:

{
"type": "response",
"code": 400,
"body": "Some error message in plain text"
}

In order to provide more details about the error when necessary, we introduce structured errors.

This new behavior is enabled by the Feature Toggle shyrkaStructuredErrors.

Standard errors are still possible:

{
"type": "response",
"class": "string",
"code": 400,
"body": "Some error message in plain text"
}

Structured errors namely apply to the "onAttachment" request:

{
"type":"response",
"class":"GenerateUrlError",
"code":4001,
"body":{
"errorCode": 4001,
"errorMessage": "File type image\/gif not supported",
"timestamp": "2022-01-28T11:57:00.000Z",
"attachmentId": "000000-0000-0000-00000000"
}
}

and to the errors due to rate limiting:

{
"type":"response",
"class":"TooManyRequestsErrorMessage",
"code":429,
"body": {
"errorCode": 429,
"errorMessage": "Request rate too high for this session",
"retryAfter": 2,
}
}

Change Category

API

Change Context

Ability to provide additional details in error messages when necessary

Change Impact

Error handling may need to be updated

Date of Change

Mar 31, 2022

Impacted APIs

Web messaging Guest API

References

SHYRKA-1217

This topic was automatically closed 62 days after the last reply. New replies are no longer allowed.