401 unauthorised for POST /api/v2/requests

3 Commentaires

  • Ahmed Zaid
    User Group Leader Community Moderator

    HiJames Macpherson,

    There are 2 factors to consider here: authenticated and unauthenticated requests:

    It is true that anonymous requests are allowed and do not need any authentication. However, this needs to be configured in theAdmin center>People>Configuration>最终用户>Anybody can submit a ticketas seen below:

    As for authenticated requests, you mentioned you used a bearer token generated from API token. Not sure what you meant here but need to use basic authentication for API tokens. Only scoped OAuth tokens can be used as a bearer token. More detailshere.

    I hope that helps.

    0
  • James Macpherson

    Hi Ahmed,

    My settings are Enabled for 'Anybody can submit tickets'

    Thanks for that, I tried the Basic authentication and base64 encoded the following structure:

    jdoe@example.com/token:[REDACTED BY ZENDESK]

    and have also tried without token (just {email}/{password} encoded)

    I'm sending a payload such as:

    {
    "request": {
    "requester": {"name": "Anonymous customer", "email": "james@test.com"},
    "subject": "Help!",
    "comment": {"body": "My printer is on fire!" }
    }
    }

    And now receive a 422 Unprocessable Entity.


    0
  • Greg Katechis
    Zendesk Developer Advocacy

    Hi James! I see that you had a ticket open for this issue and from what I can tell, everything appears to be resolved now. If that's not correct, let me know what you're stuck on!

    0

Vous devezvous connecter倒自由联合国commentaire.

Réalisé par Zendesk