I get 503 when trying to GET profile using identifiers

5 댓글

  • Greg Katechis
    Zendesk Developer Advocacy
    Hi Dennis! We usually see a 503 if your account doesn't have access to the Profiles API. To get access to this, you will need to be on a Suite Team plan or above, as we document here. If you're not sure what plan type you have, check with the owner of your instance and they'll be able to let you know! If you are making these calls from an account that does have access to this, let me know and we can dig further into this.
    0
  • Dennis Xiao

    Hi Greg, we are on Elite plan.

    0
  • Dennis Xiao

    I can get Deal data using

    client.get("deal.contact")


    Only the Profile API returns 503, like the following method trying to create a mocked profile. I'm following this doc. Any configuration do we need to make to enable Profile API?

    async function createMockedProfile(client) {
    const mockedProfile = {
    "profile": {
    "identifiers": [
    {
    "type": "email",
    "value": "dennis.xiao@example.com"
    },
    ],
    "attributes": {
    "clearedToBook": "Yes",
    }
    }
    }

    const settings = {
    url: '/api/v2/user_profiles?identifier=github:client:email:dennis.xiao@example.com',
    type: "PUT",
    contentType: 'application/json',
    data: JSON.stringify(mockedProfile)
    };

    client.request(settings).then(
    (response) => {
    console.log('response', response)
    console.log('Mocked profile created');
    },
    errorResponse => {
    console.error('Mocked profile failed to be created');
    }
    )
    }
    0
  • Dennis Xiao

    If we use `cors: true`, I would get a status of `0`. Any pointer is really appreciated. Thanks.

    {
        "readyState": 4,
        "responseText": "",
        "status": 0,
        "statusText": "error"
    }

     

    function requestProfileData(client, identifierObject) {
    const { profileSource, profileType, identifierType, identifierValue } = identifierObject;
    const settings = {
    url: `https://subdomain.zendesk.com/api/v2/user_profiles?identifier=${profileSource}:${profileType}:${identifierType}:${identifierValue}`,
    type: "GET",
    cors: true,
    headers: {
    "Authorization": "secret string"
    }
    };

    console.log('settings', settings)

    client.request(settings).then(
    profileData => {
    console.log('profileData', profileData)
    displayProfileData(profileData);
    },
    errorResponse => {
    console.log('errorResponse=======', errorResponse)
    displayError(errorResponse);
    }
    );
    }
    0
  • Greg Katechis
    Zendesk Developer Advocacy
    Hi Dennis...the Elite plan is not a Suite plan, which is the reason you don't have access to this functionality. You'll want to have your instance owner reach out to the account team to be able to assist you with this.
    0

댓글을 남기려면 로그인하세요.

Zendesk 제공