POST api/Tickets/NewTicket

Creates a new Ticket.

Request Information

URI Parameters

None.

Body Parameters

NewTicketPost
NameDescriptionTypeAdditional information
Type

(Required) Ticket type to create.

TicketTypeEnum

None.

ServiceId

Service Id, optional for TIC, required for other types (INC, REQ, PRO, CHG).

integer

None.

TicketUserSourceID

TicketUserSource Id, if not specified, API is used

integer

None.

Subject

(Required) Subject.

string

None.

Message

(Required) Description details.

string

None.

Html

True if the Message is in html format.

boolean

None.

IsMobileDevice

If true, the ticket has been sent from a mobile device (phone, tablet).

boolean

None.

Attachments

(Optional) Attachments

Collection of NewAttachment

None.

CustomForms

(Optional) The Custom Forms data.

Collection of CustomFormNewTicketPost

None.

Priorities

The prority value id.

Collection of PriorityData

None.

CustomerId

(Optional) Bind the ticket with Customer.

integer

None.

ServiceMailboxId

(Optional) Bind the ticket with service mailbox. If binded, the ticket will behave as it has came into the system by e-mail. That primarily means the email replies will be send instead of email notifications if the service mailbox is set as shielded from the Requestor.

integer

None.

SubmitterUserProviderKey

(Optional) If specified, a client (requester) of the ticket will be set (to someone else than to the authorized in user). Authorized user must have administrator, superoperator or operator role.

string

None.

SubmitterEmail

(Optional) If specified, a client (requester) of the ticket is searched in the system. If not found, it will be created new account automatically. Authorized user must have administrator, superoperator or operator role.

string

None.

SolverUserProviderKey

(Optional) If specified, a solver of the ticket will be set. The Operator role is required.

string

None.

CloseImmediately

If true, the ticket will be closed immediately. The Operator role is required.

boolean

None.

CategoryItemsIds

(Optional) The category items id.

Collection of integer

None.

ProductItemsIds

(Optional) The product items id.

Collection of integer

None.

Tags

(Optional) The tag names to be added. Fill the names of tags you want to add when the ticket is created. If the tag with the same name (case insensitive) already exists in the system list, it will be binded. If it doesn't it will be created with default colors first and then binded.

Collection of string

None.

SendViaOutboundEmail

If true, the ticket will be created and sent to the requester by email.

boolean

None.

SendViaOutboundEmailFrom

The From field Email address when the email for requester is created. It has to correspond to the email address of the selected mailbox (ServiceMailboxId). If SendViaOutboundEmail is true, this is required.

string

None.

SendViaOutboundEmailTo

Email recipient (= ticket requester). If SendViaOutboundEmail is true, this is required.

string

None.

SendViaOutboundEmailCc

(Optional) CC (carbon copy) emails.

Collection of string

None.

SendViaOutboundEmailBcc

(Optional) BCC (blind carbon copy) emails.

Collection of string

None.

Request Formats

application/json, text/json

Sample:
{
  "Type": 1,
  "ServiceId": null,
  "TicketUserSourceID": 5,
  "Subject": "I cannot access to the net printer",
  "Message": "I don't know why, it was operating yesterday.",
  "Html": false,
  "IsMobileDevice": false,
  "Attachments": [
    {
      "FileName": "sample.txt",
      "ContentType": "text/plain",
      "ContentLength": 5,
      "Data": "aGVsbG8="
    }
  ],
  "CustomForms": [
    {
      "CustomFormId": 1,
      "ServiceId": null,
      "CategoryItemId": 1,
      "CustomFormFieldsData": [
        {
          "CustomFormFieldId": 14,
          "TextBoxValue": "Typed text",
          "DecimalValue": null,
          "IntegerValue": null,
          "CheckBoxValue": null,
          "DateValue": null,
          "SelectedCustomFormFieldItemId": null,
          "CustomFormFieldItems": null
        },
        {
          "CustomFormFieldId": 15,
          "TextBoxValue": null,
          "DecimalValue": null,
          "IntegerValue": 11,
          "CheckBoxValue": null,
          "DateValue": null,
          "SelectedCustomFormFieldItemId": null,
          "CustomFormFieldItems": null
        },
        {
          "CustomFormFieldId": 16,
          "TextBoxValue": null,
          "DecimalValue": null,
          "IntegerValue": null,
          "CheckBoxValue": null,
          "DateValue": null,
          "SelectedCustomFormFieldItemId": 68,
          "CustomFormFieldItems": null
        },
        {
          "CustomFormFieldId": 17,
          "TextBoxValue": null,
          "DecimalValue": null,
          "IntegerValue": null,
          "CheckBoxValue": true,
          "DateValue": null,
          "SelectedCustomFormFieldItemId": null,
          "CustomFormFieldItems": null
        },
        {
          "CustomFormFieldId": 18,
          "TextBoxValue": null,
          "DecimalValue": null,
          "IntegerValue": null,
          "CheckBoxValue": null,
          "DateValue": null,
          "SelectedCustomFormFieldItemId": null,
          "CustomFormFieldItems": [
            {
              "CheckBoxValue": false,
              "CustomFormFieldItemId": 200
            },
            {
              "CheckBoxValue": true,
              "CustomFormFieldItemId": 201
            }
          ]
        }
      ]
    }
  ],
  "CustomerId": null,
  "ServiceMailboxId": 2,
  "SubmitterUserProviderKey": null,
  "SubmitterEmail": null,
  "SolverUserProviderKey": null,
  "CloseImmediately": false,
  "CategoryItemsIds": null,
  "ProductItemsIds": null,
  "Tags": [
    "První štítek",
    "Druhý štítek"
  ],
  "SendViaOutboundEmail": true,
  "SendViaOutboundEmailFrom": "company@domain.com",
  "SendViaOutboundEmailTo": "john.doe@domain.com",
  "SendViaOutboundEmailCc": [
    "jane.doe@domain.com",
    "jack.more@domain.com"
  ],
  "SendViaOutboundEmailBcc": null
}

application/xml, text/xml

Sample:
<NewTicketPost xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <Attachments xmlns:d2p1="http://schemas.datacontract.org/2004/07/RequestorApiDataStructures.DataStructures">
    <d2p1:NewAttachment>
      <d2p1:ContentLength>5</d2p1:ContentLength>
      <d2p1:ContentType>text/plain</d2p1:ContentType>
      <d2p1:Data>aGVsbG8=</d2p1:Data>
      <d2p1:FileName>sample.txt</d2p1:FileName>
    </d2p1:NewAttachment>
  </Attachments>
  <CategoryItemsIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" i:nil="true" />
  <CloseImmediately>false</CloseImmediately>
  <CustomForms xmlns:d2p1="http://schemas.datacontract.org/2004/07/RequestorApiDataStructures.Posts">
    <d2p1:CustomFormNewTicketPost>
      <d2p1:CategoryItemId>1</d2p1:CategoryItemId>
      <d2p1:CustomFormFieldsData>
        <d2p1:CustomFormNewTicketPost.CustomFormFieldData>
          <d2p1:CheckBoxValue i:nil="true" />
          <d2p1:CustomFormFieldId>14</d2p1:CustomFormFieldId>
          <d2p1:CustomFormFieldItems i:nil="true" />
          <d2p1:DateValue i:nil="true" />
          <d2p1:DecimalValue i:nil="true" />
          <d2p1:IntegerValue i:nil="true" />
          <d2p1:SelectedCustomFormFieldItemId i:nil="true" />
          <d2p1:TextBoxValue>Typed text</d2p1:TextBoxValue>
        </d2p1:CustomFormNewTicketPost.CustomFormFieldData>
        <d2p1:CustomFormNewTicketPost.CustomFormFieldData>
          <d2p1:CheckBoxValue i:nil="true" />
          <d2p1:CustomFormFieldId>15</d2p1:CustomFormFieldId>
          <d2p1:CustomFormFieldItems i:nil="true" />
          <d2p1:DateValue i:nil="true" />
          <d2p1:DecimalValue i:nil="true" />
          <d2p1:IntegerValue>11</d2p1:IntegerValue>
          <d2p1:SelectedCustomFormFieldItemId i:nil="true" />
          <d2p1:TextBoxValue i:nil="true" />
        </d2p1:CustomFormNewTicketPost.CustomFormFieldData>
        <d2p1:CustomFormNewTicketPost.CustomFormFieldData>
          <d2p1:CheckBoxValue i:nil="true" />
          <d2p1:CustomFormFieldId>16</d2p1:CustomFormFieldId>
          <d2p1:CustomFormFieldItems i:nil="true" />
          <d2p1:DateValue i:nil="true" />
          <d2p1:DecimalValue i:nil="true" />
          <d2p1:IntegerValue i:nil="true" />
          <d2p1:SelectedCustomFormFieldItemId>68</d2p1:SelectedCustomFormFieldItemId>
          <d2p1:TextBoxValue i:nil="true" />
        </d2p1:CustomFormNewTicketPost.CustomFormFieldData>
        <d2p1:CustomFormNewTicketPost.CustomFormFieldData>
          <d2p1:CheckBoxValue>true</d2p1:CheckBoxValue>
          <d2p1:CustomFormFieldId>17</d2p1:CustomFormFieldId>
          <d2p1:CustomFormFieldItems i:nil="true" />
          <d2p1:DateValue i:nil="true" />
          <d2p1:DecimalValue i:nil="true" />
          <d2p1:IntegerValue i:nil="true" />
          <d2p1:SelectedCustomFormFieldItemId i:nil="true" />
          <d2p1:TextBoxValue i:nil="true" />
        </d2p1:CustomFormNewTicketPost.CustomFormFieldData>
        <d2p1:CustomFormNewTicketPost.CustomFormFieldData>
          <d2p1:CheckBoxValue i:nil="true" />
          <d2p1:CustomFormFieldId>18</d2p1:CustomFormFieldId>
          <d2p1:CustomFormFieldItems>
            <d2p1:CustomFormNewTicketPost.CustomFormFieldData.CustomFormFieldItemData>
              <d2p1:CheckBoxValue>false</d2p1:CheckBoxValue>
              <d2p1:CustomFormFieldItemId>200</d2p1:CustomFormFieldItemId>
            </d2p1:CustomFormNewTicketPost.CustomFormFieldData.CustomFormFieldItemData>
            <d2p1:CustomFormNewTicketPost.CustomFormFieldData.CustomFormFieldItemData>
              <d2p1:CheckBoxValue>true</d2p1:CheckBoxValue>
              <d2p1:CustomFormFieldItemId>201</d2p1:CustomFormFieldItemId>
            </d2p1:CustomFormNewTicketPost.CustomFormFieldData.CustomFormFieldItemData>
          </d2p1:CustomFormFieldItems>
          <d2p1:DateValue i:nil="true" />
          <d2p1:DecimalValue i:nil="true" />
          <d2p1:IntegerValue i:nil="true" />
          <d2p1:SelectedCustomFormFieldItemId i:nil="true" />
          <d2p1:TextBoxValue i:nil="true" />
        </d2p1:CustomFormNewTicketPost.CustomFormFieldData>
      </d2p1:CustomFormFieldsData>
      <d2p1:CustomFormId>1</d2p1:CustomFormId>
      <d2p1:ServiceId i:nil="true" />
    </d2p1:CustomFormNewTicketPost>
  </CustomForms>
  <CustomerId i:nil="true" />
  <Html>false</Html>
  <IsMobileDevice>false</IsMobileDevice>
  <Message>I don't know why, it was operating yesterday.</Message>
  <ProductItemsIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" i:nil="true" />
  <SendViaOutboundEmail>true</SendViaOutboundEmail>
  <SendViaOutboundEmailBcc xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" i:nil="true" />
  <SendViaOutboundEmailCc xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>jane.doe@domain.com</d2p1:string>
    <d2p1:string>jack.more@domain.com</d2p1:string>
  </SendViaOutboundEmailCc>
  <SendViaOutboundEmailFrom>company@domain.com</SendViaOutboundEmailFrom>
  <SendViaOutboundEmailTo>john.doe@domain.com</SendViaOutboundEmailTo>
  <ServiceId i:nil="true" />
  <ServiceMailboxId>2</ServiceMailboxId>
  <SolverUserProviderKey i:nil="true" />
  <Subject>I cannot access to the net printer</Subject>
  <SubmitterEmail i:nil="true" />
  <SubmitterUserProviderKey i:nil="true" />
  <Tags xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>První štítek</d2p1:string>
    <d2p1:string>Druhý štítek</d2p1:string>
  </Tags>
  <TicketUserSourceID>5</TicketUserSourceID>
  <Type>EndUserTicket</Type>
</NewTicketPost>

Response Information

Resource Description

Returns ticket REF

NewTicketResult
NameDescriptionTypeAdditional information
TicketREF

Reference ID of the newly created Ticket

string

None.

TicketId

The unique identifier of the newly created Ticket

integer

None.

Response Formats

application/json, text/json

Sample:
{
  "TicketREF": "TIC-000023",
  "TicketId": 123
}

application/xml, text/xml

Sample:
<NewTicketResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/RequestorApiDataStructures.Results">
  <TicketId>123</TicketId>
  <TicketREF>TIC-000023</TicketREF>
</NewTicketResult>