API menu

ServiceNow Incident

Introduction

The ServiceNow Incident API allows you to manage your IT service management processes from one place. Use the API to log or update incident tickets for KPN products and services you use.

API specification

Test the API on SwaggerHub

Base URL

https://api-prd.kpn.com/network/kpn/incident

Conceptual model

KPN ServiceNow conceptual model

Prerequisites

You need to be a KPN business market customer and have a KPN service contract for the products and services bought from KPN.

Definitions

CI

A configuration item (CI) is any service component, infrastructure element, or other item that needs to be managed in order to ensure the successful delivery of services.

Ticket

A ticket is a log file of a reported incident with a contracted KPN service or piece of KPN equipment. The ticket describes the situation, reports a contact person and is stored in the ServiceNow system.

Base64

Base64 is an encoding algorithm that allows you to transform any characters into an alphabet that consists of Latin letters, digits, plus and slash.

API workflow

KPN ServiceNow API workflow

Features and constraints

Features

  • Create a new incident ticket in ServiceNow.
  • Comment to an existing ticket.
  • Reopen a previously resolved ticket.
  • Close a resolved ticket.
  • Attachments to incidents are supported.

Constraints

  • CI type must be chosen from a predefined list of values.
  • Attachments must be Base64 encoded.
  • Maximum total size of attachments is 10Mb.

Getting started

Make sure you've read What's in it for you for more info on how to register and start testing APIs.

Authentication

The API follows the KPN Store API Authentication Standard to secure the API. It includes the use of OAuth 2.0 client_id and client_secret to receive an access token.

Go to the Authentication tab on top of this page to find out how to:

  • Authenticate to an API using cURL.
  • Authenticate to an API on Swaggerhub.
  • Import Open API Specifications (OAS), also called Swagger files into Postman.

How to...

Create a new Incident-ticket

The following endpoint creates a new incident-ticket:

POST /NewIncident

Request

You can send JSON content in the request body:

Request example
{ "reference_number": "ABC1234", "short_description": "Test short description.", "description": "Test description.", "ci": "ESB BIZTALK KPN", "service": "string", "attachments": [ { "name": "test.txt", "content": "IQ0KZW5hYmxlIHNlY3JldCBjaXNjbw0KIQ0KIQ0KIQ0KIQ0KIQ0KIQ0KIQ0Kbm8gaXAgc291cmNlLXJvdXRlDQohDQohDQohDQohDQohDQohDQohDQohDQoNCg0KIQ0KaXAgd1ZXVlIDEwMCBvdCiBwZXJtaXQgdWQogdHJhbnNwb3J0IGlucHV0IHRlbG5ldA0KIQ0KZW5k" } ] }
Item Description
reference_number    Unique reference number from the source system.
short_description A short description of the incident.
ci The CI or service for which the incident is reported.
description Details on the incident.
service Service applicable for ticket.
attachment name Name of the file with file extension.
attachment content Base64 coded content of the attachment.

Response

The response provides you with the ticket number and the reference number of the incident.

Response example
{ "result": { "state": "inserted", "ticket_number": "INC1234", "reference_number": "ABC1234", "sys_id": "e61ba982db43db807f1f14794b961943", "note": "INC1234 Incident is created successfully." } }

Update an incident

The following endpoint updates an incident-ticket:

PATCH /UpdateIncident

Request

Send JSON content in the request body:

Example request`
{ "action": "Comment", "comment": "New comment update", "ticket_number": "INC1234", "reference_number": "ABC1234", "attachments": [ { "name": "test.txt", "content": "IQ0KZW5hYmxlIHNlY3JldCBjaXNjbw0KIQ0KIQ0KIQ0KIQ0KIQ0KIQ0KIQ0Kbm8gaXAgc291cmNlLXJvdXRlDQohDQohDQohDQohDQohDQohDQohDQohDQoNCg0KIQ0KaXAgd1ZXVlIDEwMCBvdCiBwZXJtaXQgdWQogdHJhbnNwb3J0IGlucHV0IHRlbG5ldA0KIQ0KZW5k" } ] }
Item Description
action Displays either Comment, Close or Reopen.
comment Displays the comment.
ticket_number Reference number that was received upon creating the incident ticket.
reference_number Unique reference number from the source system.
attachment name Name of the file with the file extension.
attachment content Base64 coded content of the attachment.

Response

The response provides you with the ticket number and the reference number of the updated incident.

Retrieve active incidents

This endpoint returns all active incidents that were issued by you.

GET /GetActiveIncidents

Request

You don't need to provide any parameters.

Response

Response example
{ "result": [ { "reference_number": "INC1234", "short_description": "short note", "state": "Finished", "ticket_number": "INC1234" } ] }

Retrieve single incident

This endpoint returns all data of a single incident:

GET //GetIncident/{ticket number}

Request

Send the ticket number as the path parameter.

Response

Response example
{ "result": { "ticket_number": "INC1234", "reference_number": "ABC1234", "short_description": "short note", "state": "Finished", "company": "KPN B.V.", "description": "textual description", "contact": "B. Person", "user": "A. Person", "category": "Incident", "priority": "Incident Ticket Priority 1,2,3", "impact": "Incident Ticket Impact 1,2,3", "urgency": "Incident Ticket urgency 1,2,3", "ci": "XYZ_001P", "customer_service": "Diensten", "service_component": "Service", "sla_due": {}, "pending_reason": "awaiting vendor", "required_information": "Please provide documentation", "reason_user_required": "test solution provided", "close_code": "Finished", "solution": "Software Installed" } }

The response returns all details of the incident, including priority, impact, urgency and pending reason.