Creating a ticket with requester as submitter through the v2 API

Answered

Comments

14 comments

  • Avatar
    Rob Eyre

    Somewhat related to this, I'd like to be able to add comments from specific authors to tickets via the API.  I've tried setting 'author_id' here:

    {"ticket":{"comment":{"public":false,"value":"Bar"},"author_id":1234546}}

    and here:

    {"ticket":{"comment":{"public":false,"value":"Bar","author_id":123456}}}

    but it is silently ignored, and instead the comment is added with the API user as the author.

    Any ideas?

    Thanks

    -Rob

  • Avatar
    Ted Barnum

    Both the submitter_id and author_id are Read Only fields, and so can not be set.

    The X-On-Behalf-Of: Header will not work for Agents assuming end users, as there is no call open directly to end users in the V2 API.

    Our Developers are working on something for the V2 API to allow something like creating requests on behalf of an end user in the V1 API, and it is hoped to be out in the near future.

     

  • Avatar
    Steven Yan

    Hi everyone, please see our new Requests API: https://support.zendesk.com/entries/21964887-comment-as-the-customer-with-the-new-requests-api  This API is intended to allow you to create or update tickets as an end-user and replaces the X-On-Behalf-Of behavior from API v1.

  • Avatar
    Nacer Laradji

    I have the same issue with the new comment restriction, i can't add a author_id or submitter_id or requester_id  in v2.

    So how can a Admin can add a comment in the name of one user now ? 

  • Avatar
    Joe Van Dyk

    I'm also having problems. I'd like to have a form on my site where a user comes in, types in their email address and their problem, and I'd submit the form to Zendesk. I can't figure out how to create the ticket and have it appear as if they made it. They may or may not be in the zendesk system already.

  • Avatar
    DeVaris Brown

    Hey Joe! Have you seen the documentation here: http://developer.zendesk.com/documentation/rest_api/tickets.html#creating-a-ticket-with-a-new-requester

    I think this answers your question. Just pass in the value from the email field into the requester:email field in your JSON and it will create the ticket and sends a signup email to the new user. If the user email address already exists, it will add this ticket to their account.

  • Avatar
    Joel P

    That is an incomplete solution. See these two articles I created:

    https://support.zendesk.com/entries/22135701-api-create-end-users-through-requests-endpoint

    https://support.zendesk.com/entries/22547116-requestor-vs-submitter

    When you use the tickets.json end point, the "submitter" is the agent whose credentials were used for authentication. Zendesk shows this agent as person who entered the comment (it does not even show "on behalf of" anymore). 

    I need a way to create tickets that are both** Submitted AND Requested** by a new end-user.

  • Avatar
    DeVaris Brown

    @Joel are you talking about in the agent interface? We've addressed this in the API level, but the agent interface has yet to reflect this. It's a known bug that we are fixing in an upcoming release.

  • Avatar
    Joel P

    No, I'm talking about the API. I just tried submitting a test request using the method described at:

    https://support.zendesk.com/entries/21964887-comment-as-the-customer-with-the-new-requests-api

    However, if the end-user email used to authenticate isn't already in Zendesk I get a Unauthorized error "Couldn't authenticate you".

  • Avatar
    KK

    this solution is really an incomplete solution.

    i like to set submitter and requester. both are ignored when i am logging in over the api as zendesk owner.

    i like to do this without use the credentials of my users or my token with their email addresses.

     

     

  • Avatar
    Bas van Houtum

    Is there any news when it is possible to submit a comment on behalf of another user?

  • Avatar
    Clinton Cory

    Does submitter_id not work? You should be able to specify the submitter_id of the ticket creation request. For new users, you'd need to create the user, determine their id, and then create the ticket with the submitter_id of that user assigned.

    For reference, 

    Some base sample code for creating tickets can be found here:
    http://pastebin.com/u/Mushroomheadbangers

    Might be easier to work with.

  • Avatar
    Gurdeep Singh (Edited )

    Error creating tickets. "-v is not registered as internal or external command"

    curl https://chloeai.zendesk.com/api/v2/tickets.json \
    -d "{\"ticket\":{\"subject\":\"TEST TICKET\",\"requester\":{\"name\":\"John\",\"email\":

    \"somebody@gmail.com\"}, \"description\":\"TEST TICKET\nby John\"}}" \
    -H "Content-Type: application/json" \ -H "X-On-Behalf-Of:dev.bitlifeinfotech@gmail.com"\
    -v -u chloeapi1234+zendesk@gmail.com/token:dsq

    What could be the possible solution.

  • Avatar
    James Peterson

    Hi Gurdeep,

    The -v is for showing more information about the request, it means verbose.  You could try removing it.  Also, I'm curious why you are including the heaer "X-On-Behalf-Of" as that is not included in the API documentation.  Finally, I'd suggest you change your API token as this is a public forum, and with the token you shared here any user can gain access to your Zendesk.

Please sign in to leave a comment.

Powered by Zendesk