A
Overview
An API (Application Programming Interface) is a set of rules that allow programs to interact with each other. One such rule allows you to get a piece of information (resource) when you link to a specific URL or retrieve ticket information via a smart phone or a third party service. Each URL is a 'request' and the data sent back to you is known as a 'response'.
The Intelligent Service Management (ISM) Web Services allows you to encode your calls using REST (Representational State Transfer) API. REST is an architectural style that defines how applications communicate over HTTP (Hypertext Transfer Protocol). It is usually associated with exchanging JSON (JavaScript Object Notation) and XML (Extensible Markup Language) documents between a client and a server. To learn more about REST APIs, refer to REST API basics.
As an administrator you can validate the information using Swagger to create, update, and delete resources. Swagger is a commonly used web application to document APIs. With Swagger Serviceaide has built a simple way for developers to understand this API. In this article, we will guide you through an example for the methods related to creating, updating, and deleting an incident and how the method responds to requests.
The following HTTP methods are used in REST APIs. Use:
- GET to retrieve a resource from a server.
- POST to create a new resource on a server.
- PUT to edit or update a resource on a server, which can be an object or file.
- DELETE to remove a resource from a server.
Status Codes/Response Code
It is important for client applications to manage HTTP status codes correctly. Status codes convey the results of your request. The following status code applies to the REST API.
Status Code | Description |
---|---|
200 | Success |
201 | Created |
204 | No content |
400 | Bad request |
403 | Forbidden |
404 | Not found |
500 | Internal server error |
How to Use Swagger
You can access Swagger using the ISM environment followed by the swagger URL as follows: https://<datacenter>.serviceaide.com/csmconnector/swagger-ui.html
Here are the Staging environment URLs
- CSMStaging: https://csmstaging.serviceaide.com/csmconnector/swagger-ui.html
- CSM2Staging: https://csm2staging.serviceaide.com/csmconnector/swagger-ui.html
- CSM5Staging: https://csm5staging.serviceaide.com/csmconnector/swagger-ui.html
Here are the Production environment URLs
- CSM2: https://csm2.serviceaide.com/csmconnector/swagger-ui.html
- CSM3: https://csm3.serviceaide.com/csmconnector/swagger-ui.html
- CSM5: https://csm5.serviceaide.com/csmconnector/swagger-ui.html
Prerequisites
Any user who has the following information can use the REST API to create, update, and delete resources.:
- ISM app URL.
- AuthToken: auth token can only be accessed through the API user. AuthToken is required to authenticate the API user's request.
Note: API user is created solely for the purpose of integration. To create an API user, you must contact Serviceaide Support. There is one API user for each slice. - Slice token
- Web service username
- Web service user password
How to Access AuthToken
To copy AuthToken, perform the following steps:
- On the Manage menu, click Tools and then Users.
- Select the Filter tab and select System Users from the By Type group.
- Click Apply to view the API User in the list.
- Click to edit properties. The API User page is displayed.
- Copy the AuthToken from the Basic Information section in the API User page.
Note
Each Slice is entitled to one API user for using the REST API
How to Access Slice Token
To copy slice token, perform the following steps:
- On the Manage menu, click Tools and then Slice Configuration. The Slice Configuration page is displayed.
- Copy the slice token by clicking the General Information tab.
GET Method - Incident
While retrieving a record such as incident, from a server, you can learn how APIs use HTTP methods and Response codes to differentiate operations and results. The following example describes how you can retrieve the existing incidents record.:
- Click GET or Expand Operations to retrieve information.
- Specify the following details in the Parameters section.:
- ISM application URL
- User authtoken
- Slice token
- Web service user name and password - Click Try it out. You will get the response as follows.
Response
After the GET request is executed, a response is received in the following format as specified below.
POST Method- Incident
You can use a POST method to create a new resource such as incident, request, and so on. The following example describes how you can create a new incident.
- Click POST to create information.
- Specify the following details in the Parameters section.:
- ISM application URL
- User authtoken
- Slice token
- Web service user name and password - Click the Example Value text box. The operations displayed in the text box will be copied to the Incident text box.
- Click Try it out. You will get the response as follows.
Valid Ticket Attributes
The following information is displayed in the Example Value box. This is applicable to all the ticket types.
Name | Description |
---|---|
ActionId | ID of the workflow need to be passed |
AffectedService | Name of the Affected Service |
AffectedServiceID | ID of the Affected Service |
ApprovalList | Not available to update/modify from the REST API |
AssignedCaseID | Not available to update/modify from the REST API |
AssignedContactID | ID of the Analyst to assign the ticket |
AssignedContactUserName | Username of the Analyst to assign the ticket |
AssignedGroup | Name of the Assigned group to assign the ticket |
AssignedGroupID | Id of the Assigned group to assign the ticket |
AssignedID | ID of the Analyst to assign the ticket |
AssignedIndividual | Username of the Analyst to assign the ticket |
AssignedIndividualExternalUserID | Not available to update/modify from the REST API |
AssignedIndividualID | ID of the Analyst to assign the ticket |
AssignedTo | Username of the Analyst to assign the ticket |
AutomatedFullfillmentDetailFields | Deprecated |
AutomationWFExecuteMode | Deprecated |
CasaWorkflowExecuteOnActionId | Deprecated |
CasaWorkflowInitiated | Deprecated |
Categorization | Hierarchy of the Categorization like "class >> category >> type >> item" |
CategorizationCategory | Name of the Category of the CCTI |
CategorizationClass | Name of the Class of the CCTI |
CategorizationID | ID of the CCTI |
CategorizationItem | Name of the Item of CCTI |
CategorizationItems | Not available to update/modify from the REST API |
CategorizationType | Worklog update to be Client viewable then pass '1' and '0' for Not to be viewable by SSU |
ClosedDateTimestamp | Not available to update/modify from the REST API |
ClosedGroupID | Not available to update/modify from the REST API |
ClosedGroupName | Not available to update/modify from the REST API |
ClosedUserName | Not available to update/modify from the REST API |
CreationById | Not available to update/modify from the REST API |
CreationGroupID | Not available to update/modify from the REST API |
CreationGroupName | Not available to update/modify from the REST API |
CreationTimestamp | Not available to update/modify from the REST API |
CreationUserName | Not available to update/modify from the REST API |
CustomFields | Need to pass the name value pair in an array as shown below "CustomAttributes": {"customattribute_name1":"customattribute_value1", "customattribute_name2":"customattribute_value2"}, |
CustomSearch | Not available to update/modify from the REST API |
CustomerImpact | Not available to update/modify from the REST API |
Description | Short description for the ticket |
DescriptionLong | Long description for the ticket |
ExternalID | Not available to update/modify from the REST API |
GUID | Not available to update/modify from the REST API |
GlobalRelationshipTicketAssignedID | Not available to update/modify from the REST API |
GlobalRelationshipTicketID | Not available to update/modify from the REST API |
GlobalRelationshipType | Not available to update/modify from the REST API |
HasAttachments | Not available to update/modify from the REST API |
Impact | Name/Label of the Impact |
ImpactCode | Code of the Impact |
IsArchived | Not available to update/modify from the REST API |
IsReadOnly | Not available to update/modify from the REST API |
IsSaveNExit | Not available to update/modify from the REST API |
KBArticleID | Not available to update/modify from the REST API |
LastModGroupID | Not available to update/modify from the REST API |
LastModGroupName | Not available to update/modify from the REST API |
LastModTimestamp | Not available to update/modify from the REST API |
LastModUserName | Not available to update/modify from the REST API |
LastWorklog | Not available to update/modify from the REST API |
LastWorklogDate | Not available to update/modify from the REST API |
LockedByExternalUserId | Not available to update/modify from the REST API |
LockedByUsername | Not available to update/modify from the REST API |
MdrElementID | Not available to update/modify from the REST API |
MetricKeysThrottled | Not available to update/modify from the REST API |
NonTranslatedParentTypeName | Not available to update/modify from the REST API |
NonTranslatedTicketStatus | Not available to update/modify from the REST API |
OrgStatus | Not available to update/modify from the REST API |
OriginalPlanedEnd | Not available to update/modify from the REST API |
OutageStartTimestamp | Not available to update/modify from the REST API |
OverrideAutoRouting | Not available to update/modify from the REST API |
Phase | Name of the Phase to be updated in the ticket |
Priority | Label of the Priority |
PriorityCode | Code of the Priority |
ProcessFlowID | Not available to update/modify from the REST API |
ProcessFlowIDStatus | Not available to update/modify from the REST AP |
ProcessGUIFlowID | Not available to update/modify from the REST API |
ReadOnlyMsg | Not available to update/modify from the REST API |
ReasonCode | Text for the Reasoncode for the ticket |
RecentActivity | Not available to update/modify from the REST API |
RelatedCI | Not available to update/modify from the REST API |
RelatedCICount | Not available to update/modify from the REST API |
RequestCatalogAttachmentId | Not available to update/modify from the REST API |
RequestCatalogDescription | Not available to update/modify from the REST API |
RequestCatalogId | Not available to update/modify from the REST API |
RequestCatalogName | Not available to update/modify from the REST API |
RequestCatalogWorkflowId | Not available to update/modify from the REST API |
RequestedForAltEmail | Not available to update/modify from the REST API |
RequestedForAltPhone | Not available to update/modify from the REST API |
RequestedForExternalUserID | Not available to update/modify from the REST API |
RequestedForID | Not available to update/modify from the REST API |
RequestedForOrgHierarchicalPath | Not available to update/modify from the REST API |
RequestedForOrgLevel | Not available to update/modify from the REST API |
RequestedForOrgName | Not available to update/modify from the REST API |
RequestedForRootOrgId | Not available to update/modify from the REST API |
RequestedForRootOrgName | Not available to update/modify from the REST API |
RequestedForUserID | ID of the RequestedFor |
RequestedForUserName | Name of the RequestedFor User |
RequestedForVIPFlag | Not available to update/modify from the REST API |
RequestedOrgID | Not available to update/modify from the REST API |
RequesterAltEmail | Not available to update/modify from the REST API |
RequesterAltPhone | Not available to update/modify from the REST API |
RequesterExternalUserID | Not available to update/modify from the REST API |
RequesterID | Id of the Requester User |
RequesterOrgHierarchicalPath | Not available to update/modify from the REST API |
RequesterOrgID | Not available to update/modify from the REST API |
RequesterOrgLevel | Not available to update/modify from the REST API |
RequesterOrgName | Not available to update/modify from the REST API |
RequesterRootOrgId | Id of the RequesterRoot Org |
RequesterRootOrgName | Name of the RequesterRoot Org |
RequesterUserID | Not available to update/modify from the REST API |
RequesterUserName | Not available to update/modify from the REST API |
RequesterUserNameWithVIPFlag | Not available to update/modify from the REST API |
RequesterVIPFlag | Not available to update/modify from the REST API |
RequiresCabApproval | Not available to update/modify from the REST API |
Resolution | Text to be populated for Resolution for the Ticket |
ResolvedDateTimestamp | Not available to update/modify from the REST API |
ResolvedGroupID | Not available to update/modify from the REST API |
ResolvedGroupName | Not available to update/modify from the REST API |
ResolvedUserName | Not available to update/modify from the REST API |
ResolvedUsing | Not available to update/modify from the REST API |
ResolvedUsingItemAssignedCaseID | Not available to update/modify from the REST API |
ResolvedUsingItemAssignedID | Not available to update/modify from the REST API |
ResolvedUsingItemID | Not available to update/modify from the REST API |
ResolvedUsingItemType | Not available to update/modify from the REST API |
RootCause | Text to be populated for Rootcause for the Ticket |
SLAComplianceStatus | Not available to update/modify from the REST API |
SLADueTargetName | Not available to update/modify from the REST API |
SLADueTimestamp | Not available to update/modify from the REST API |
SLAHolidayID | Not available to update/modify from the REST API |
SLAResolveByTimestamp | Not available to update/modify from the REST API |
SLAStartDate | Not available to update/modify from the REST API |
SLATimezoneID | Not available to update/modify from the REST API |
SendWorklogEmail | Not available to update/modify from the REST API |
Severity | Not available to update/modify from the REST API |
Source | Label of the Source |
SourceCode | Code of the Source |
SupportEmailAddress | Not available to update/modify from the REST API |
TenantId | Not available to update/modify from the REST API |
TicketAging | Not available to update/modify from the REST API |
TicketAgingRange | Not available to update/modify from the REST API |
TicketIdentifier | ID of the Ticket identifier like 100-xx, 200-xx, 300-xx, 400-xx, 500-xx |
TicketImagePath | Not available to update/modify from the REST API |
TicketStatus | Status of the Ticket |
TicketTypeId | Not available to update/modify from the REST API |
TotalTimeSpent | Not available to update/modify from the REST API |
TranslatedSLAComplianceStatus | Not available to update/modify from the REST API |
TranslatedTypeName | Not available to update/modify from the REST API |
TwoRequests | Not available to update/modify from the REST API |
TypeName | Not available to update/modify from the REST API |
Urgency | Label of the Priority |
UrgencyCode | Code of the Priority |
VIPFlag | Not available to update/modify from the REST API |
WallTicketType | Not available to update/modify from the REST API |
WorkActualDate | Not available to update/modify from the REST API |
WorkDescription | Description of the worklog |
WorkTimeSpent | Time spent in minutes |
WorkType | Not available to update/modify from the REST API |
WorkTypeCode | Not available to update/modify from the REST API |
WorklogActualDate | Not available to update/modify from the REST API always take current date |
Sample for Assigning a Ticket Using REST
{ "TicketIdentifier":"200-2", "AssignedContactUserName":"AnalystUsername", "AssignedGroup":"Administration" }
Sample for Adding a worklog and send email to the recipients (testuser@acme.com and test@acme.com) using REST
{ "TicketIdentifier":"200-3","communicationSendCC":"test@acme.com", "communicationSendTo":"testuser@acme.com", "ClientViewable":"1", "sendMail":"1", "WorklogTypeCode":"1", "Text":"The ticket has been fixed, validate and revert" }
Response
After the POST request is executed, a response is received in the following format as specified below.
Sample
GET Method - Incident/{id}
You can use this method to retrieve a specific incident details by specifying the ID. The following example describes how you can get details of a specific incident.:
- Click GET to retrieve a specific incident information.
- Specify the following details in the Parameters section.:
- ISM application URL
- User authtoken
- Slice token
- Web service user name and password
- Specify the incident ID for which you want to retrieve information. - Click Try it out. You will get the response as follows.
Now, you can validate the response code using the Status code/Response Code section in this article.
REST API Catalog
This the list of web services wrapper interface to enable access to the existing Intelligent Service Management (ISM) article contains functionality that is exposed through the Rest web services API.
0 Comments