Create Tickets
Lets you create a new ticket.
You can pass as many ticket fields (including custom fields) as you want, but it is mandatory to pass at least one of the following lead fields –
- LeadDetail.EmailAddress
- LeadId
- LeadDetail.Phone
You can find the org ID after you log in to your LeadSquared account.
API URL
Request
Content-Type: application/json{ "TypeId":"1", "Id":null, "LeadId":"45b5fded-e696-45a6-9fbb-c6af6178229e", "Fields":[ { "SchemaName":"Title", "Value":"Test ticket from API" }, { "SchemaName":"RelatedCustomerId", "Value":"45b5fded-e696-45a6-9fbb-c6af6178229e" }, { "SchemaName":"Description", "Value":"Test ticket from External API" }, { "SchemaName":"Type", "Value":"General" }, { "SchemaName":"Status", "Value":"Open" }, { "SchemaName":"Priority", "Value":"Low" }, { "SchemaName":"Channel", "Value":"Chat" } ], "RelatedTicketTypeId":1 }
Request Parameters
Parameter | Description |
---|---|
TypeId | Specifies the ticket type. Pass 1 by default. |
Id | Pass null. |
Fields | Pass the schema names of the system and custom ticket and lead fields, along with their corresponding values. You must include all the mandatory ticket fields configured in your account. Additionally, you must also include one of the following lead fields –
|
RelatedTicketTypeId | Specifies the ticket type. Pass 1 by default. |
Response
{ "Status": "Success", "ReasonForFailure": null, "Id": "34", "Message": null, "TicketId": "27e8259d-0681-4adb-b5e8-14f66a208dd4", "Key": "#034" }
HTTP Response Codes
Code | Description |
---|---|
200 OK | This is the status code for successful API call. |
401 Unauthorized | The API call was made with invalid access credentials. Check your AccessKey and SecretKey. |
400 Bad Request | The message body on the request is not as per API specification. Make sure that content type is set to “application/json” and the JSON body has correct attribute names and structure. |
404 Not Found | The API could not be found. Please check the API signature. |
429 Too Many Requests | API calls exceeded the limit of 25 in 5 second(s) |
500 Internal Server Error | The API called failed. There could be many reasons for it. Check the exception message to get more details. |