Quantcast
Channel: Symantec Connect - Products - Articles
Viewing all articles
Browse latest Browse all 818

ServiceDesk - API - Demo

$
0
0
ServiceDesk Version:8.5

Download Postman or an API client of your choice

Start by creating a new Postman Collection

  • ServiceDesk API

Create a new Environment

serverlocalhost
apiServiceDeskApi
IncidentSessionID[TestSessionId]

Create a new Request

Token

POST

http://{server}/{api}/api/authorization/token

Add a Header

Content-Typeapplication/json

Body

{
	"Username": "admin@symantec.com",
	"Password": "###"
}

Response

"GUID"

Now the useful part, in Tests you can store data that is returned in the Response, in variables. Just use some JS to parse the body returned from the call and store it in a new variable called "token".

var jsonData = JSON.parse(responseBody);
postman.setGlobalVariable("token", jsonData);

---

Incident

GET

http://{server}/{api}/api/incident/{IncidentSessionID}

Add a Header

Content-Typeapplication/json
Authorizationtoken {{token}}

Response (an Incident)

{
    "sessionId": "GUID",
    "processId": "IM-000001",
    "incidentName": "Test",
    "incidentDescription": "Test",
    "incidentType": "How To",
    "affectedUserEmail": "alex.hedley@email.com",
    "classification": "How To",
    "impact": "Single User",
    "urgency": "Non-Urgent Service",
    "priority": "Low",
    "affectedLocationId": "00000000-0000-0000-0000-000000000000",
    "affectedDepartmentId": "00000000-0000-0000-0000-000000000000",
    "status": "Assigned",
    "resolution": null,
    "closeCode": null
}

---

Note anywhere using variable {variable} add an extra set of {} as these are stripped out on the page.

Protirus.png


Viewing all articles
Browse latest Browse all 818

Trending Articles