Genesys Cloud (formerly PureCloud)

Discussion Thread View
Expand all | Collapse all

Platform API Client SDK - RoutingAPI

Jump to Best Answer
  • 1.  Platform API Client SDK - RoutingAPI

    Posted 02-22-2021 09:16
    Edited by Rene Perez Solis 02-24-2021 02:37

    I noticed when using the javascript SDK PUT /api/v2/routing/queues/{queueId} (RoutingApi
    Mypurecloud remove preview
    AlertingApi AnalyticsApi ArchitectApi AuditApi AuthorizationApi BillingApi ChatApi CoachingApi ContentManagementApi ConversationsApi DataExtensionsApi ExternalContactsApi FaxApi FlowsApi GeneralDataProtectionRegulationApi GeolocationApi GreetingsApi GroupsApi IdentityProviderApi IntegrationsApi JourneyApi KnowledgeApi LanguageUnderstandingApi LanguagesApi LicenseApi LocationsApi MobileDevicesApi NotificationsApi OAuthApi ObjectsApi OrganizationApi OrganizationAuthorizationApi OutboundApi PresenceApi QualityApi RecordingApi ReleaseNotes ResponseManagementApi RoutingApi SCIMApi ScriptsApi SearchApi SpeechTextAnalyticsApi StationsApi SuggestApi TelephonyApi TelephonyProvidersEdgeApi TextbotsApi TokensApi UploadsApi UsageApi UserRecordingsApi UsersApi UtilitiesApi VoicemailApi WebChatApi WidgetsApi WorkforceManagementApi
    View this on Mypurecloud >
    ) that when the body does not contain all attributes that some attributes get set Default.
    Example when the mediaSettings is not set in the body of request, the values gets reset to default values.
    Is this normal behaviour?

    Here an example of what I noticed:

    the body contained : "acwSettings": { "wrapupPrompt": String, "timeoutMs": Number, },
    when chaning the Queues I noticed that the Service level was resetted to default values.

    My questoin is do I alsways have to sent the full body with all options to avoid this or is this a kind of bug?

    kind regards


    Rene Perez Solis
    Genesys IT Consultant

  • 2.  RE: Platform API Client SDK - RoutingAPI

    Top 25 Contributor
    Posted 03-02-2021 00:55
    Rule of thumb:
    • Make sure all Required are sent
    • Send any information you think you might want to use
    In my experience, most calls always have strange entries when you don't supply them.  I usually start with the required, check the response and then add on the ones I just might want to have in the future.  As for your examples, there are certain dependencies as well which may not show as required, but will be if another part of programming requires the relationship.  

    Robert Wakefield-Carl
    Avtex Solutions, LLC
    Contact Center Innovation Architect

  • 3.  RE: Platform API Client SDK - RoutingAPI
    Best Answer

    Posted 03-02-2021 09:12
    This is not a bug.  Think of a PUT more as a replace than an update.  Your request defines exactly what you want it to be.  If you don't specify a particular field, it will become null or some default value if appropriate.  The safest way to do a PUT is to do a GET to fetch the object, change whatever you want to change, then send that in the PUT.  Caveat: there are a few endpoints that don't use the exact same object for a GET & PUT and you found one of them.  The GET returns a Queue but the PUT takes a QueueRequest.  However it's fairly simply to add the fields from a Queue to a new QueueRequest.

    Melissa Bailey
    Genesys - Employees

  • 4.  RE: Platform API Client SDK - RoutingAPI

    Posted 03-03-2021 02:17
    Thanks for this explenation, for now I made sure I sent the complete body and only change the values I want to be changed, to prevent default values.

    Rene Perez Solis
    Service Architect