Create Ticket Using API

9 Comments

  • Greg - Community Manager
    Comment actions Permalink

    Hi David! Could you share the URL and payload that you sent when you received this error? Please make sure that you remove any authentication or identifying information.

    0
  • David Maged
    Comment actions Permalink

    Hi Greg ,

    Here's the body :

    • {
        "title": "ticket",
        "type": "object",
        "properties": {
          "subject": {
            "type": "string"
          },
          "comment": {
            "type": "string"
          },
          "ticket": {
            "type": "string"
          }
        },
        "additionalProperties": true
      }
    • Request URL : /api/v2/tickets

    • Response ( Error )   "message": "REST call for action execute failed. Message:Request to backend service failed. Response from web service: {\n \"error\": {\n \"title\": \"Invalid attribute\",\n \"message\": \"You passed an invalid value for the ticket attribute. Invalid parameter: ticket must be a hash from api/v2/tickets/create\"\n }\n}\n [bffc60aa-0675-480c-84b7-3ece102fe8df]",
         "code": "BAD_REQUEST",
       "status": 400,  
    0
  • Greg - Community Manager
    Comment actions Permalink

    Thanks for that, David. It looks like the JSON that you're using to create a new ticket is not aligned with how we structure this. If you take a look at our API docs for creating a new ticket, you'll see an example of the payload. You can find additional attributes that are available at the top of that page as well!

    0
  • David Maged
    Comment actions Permalink

    Thanks Greg for your update , but i already tried the sample form the provided link and gives me the same error

    0
  • Greg - Community Manager
    Comment actions Permalink

    Ah, the screenshot helped, thank you! You correctly set the body to "raw", however if you look to the right of "GraphQL", you'll see that the dropdown has "Text" selected instead of "JSON". Toggle that and you should be set to go!

    Greg Katechis | Developer Support and Enablement Engineer

    0
  • David Maged
    Comment actions Permalink

    Unfortunately , it is the same 

     

    0
  • Greg - Community Manager
    Comment actions Permalink

    Ah, when I saw that I fixated on it and failed to take a look at the URL. It looks like you've appended something after the POST, so please remove everything after (and including) the question mark so that it ends with api/v2/tickets.

    Greg Katechis | Developer Support and Enablement Engineer

    0
  • David Maged
    Comment actions Permalink

    Thanks a lot Greg , now it is working from postman

    I will Try to do the same from Genesys Cloud 

    Your help is much appreciated 

     

     

    0
  • Greg - Community Manager
    Comment actions Permalink

    Glad to hear that, David. Take care!

    Greg Katechis | Developer Support and Enablement Engineer

    0

Please sign in to leave a comment.

Powered by Zendesk