Legacy Dev Forum Posts

 View Only

Sign Up

External Contact Tutorial Not Working Now

  • 1.  External Contact Tutorial Not Working Now

    Posted 06-05-2025 18:15

    Dan_Fontaine | 2019-08-08 00:15:45 UTC | #1

    When I first used the External Contact Tutorial we were at version 27 of purecloud-platform-client-v2 and it worked.

    I just updated to the latest version (53) of purecloud-platform-client-v2 and when I run the tutorial it fails at adding an organization (422 - as if something required were empty).

    If I re-install version 27, it works like it did before - no problem.

    What am I missing?


    tim.smith | 2019-08-08 14:17:21 UTC | #2

    I'm not sure what would cause that change, but I've created issue API-4631 to get the tutorial updated. In the meantime, I'd suggest taking a look at the SDK documentation for that function to see what it's currently expecting. The error response often indicates what's incorrect with the request.


    Dan_Fontaine | 2019-08-08 15:05:25 UTC | #3

    Yes, that is what I thought too. I used the API Explorer in Developer Tools and attempted to recreate the error - the only way that you get the same error is if you send 'name' as blank.That is the only field that is required (name).

    The message did not give an indication of what is missing:

    {"status":422,"code":"validation.failed","message":"The content you have sent contains 1 validation errors.","messageParams":{},"contextId":"46b47a6e-430b-4ad5-bda4-06c3de83e557","details":[],"errors":[{"status":422,"code":"validation.failed","message":"must not be empty","messageParams":{},"details":[],"errors":[]}]}'

    Again, it works with version 27. I do not get the error. Maybe if I have time I will see what versions work and what versions do not.


    Dan_Fontaine | 2019-08-08 18:47:10 UTC | #4

    Figured it out:

    To get the tutorial to work with SDK version 28 and beyond, you need to change:

    // Create new external organization return externalContactsApi.postExternalcontactsOrganizations({ body: organization });

    to:

    // Create new external organization externalContactsApi.postExternalcontactsOrganizations(organization);

    and

    // Create contact and collect promise let contactPromise = externalContactsApi.postExternalcontactsContacts({ body: contact })

    to:

    // Create contact and collect promise let contactPromise = externalContactsApi.postExternalcontactsContacts(contact)

    For version 27 and below, you need to use the {body: variable} syntax.


    system | 2019-09-08 18:47:14 UTC | #5

    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: 5731