{ "swagger": "2.0", "info": { "version": "2.1.5", "title": "TokenRefreshService" }, "host": "api.kiwirail.co.nz", "basePath": "/V1/tokens/", "schemes": [ "http", "https" ], "paths": { "/refresh": { "post": { "description": "Present a refresh JWT to gain a new access JWT and new refresh JWT", "tags": [ "JWT" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "body", "in": "body", "required": true, "description": "Contains the request details.", "schema": { "$ref": "#/definitions/refreshRequestBody" } }, { "name": "version", "in": "header", "type": "integer", "format": "int32", "description": "The version of this message format." }, { "name": "transactionID", "in": "header", "type": "string", "format": "string", "description": "An unique identifier for a set of messages belonging to each other. Can be null if t here is no transaction ID attached to this message. Identifier is defined as ___UUID for example" }, { "name": "messageID", "in": "header", "type": "string", "format": "string", "description": "Unique identifier for this message. This is similar to the Mule ESB MessageID who would use this id internally. The message ID should only exist for the message between two systems, so a stream over three components will use two messageIDs one for component A to B and one from B to C. This value cannot be set by the caller." }, { "name": "currentSystem", "in": "header", "type": "string", "format": "string", "description": "System that generated the message" }, { "name": "userInitiatingRequest", "in": "header", "type": "string", "format": "string", "description": "User requesting/submitting information Login ID" }, { "name": "sequenceID", "in": "header", "type": "string", "format": "string", "description": "Unique identifier for a sequence of messages. When null the message is not part of a sequence, if not null, the sequence number should be non 0" }, { "name": "sequenceNumber", "in": "header", "type": "integer", "format": "int32", "description": "0,> for messages that are split up but need to be processed in order. When 0 this message is not part of a sequence. When not 0 the SequenceID is mandatory" }, { "name": "creationTimestamp", "in": "header", "type": "string", "format": "date-time", "description": "Date of creation of the message in YYYY-MM-DD hh:mm:ss:ms in NZDT" }, { "name": "auditCategory", "in": "header", "type": "string", "format": "string", "description": "Holds a string that can be used to collect log information over all services." }, { "name": "payloadEncrypted", "in": "header", "type": "boolean", "format": "boolean", "description": "If true the payload is encrypted, when false it is not. This is set for the content encryption(like GPG), not the connection (like SSL)" }, { "name": "payloadEncoding", "in": "header", "type": "string", "format": "string", "description": "When the payload is text, it should contain the text encoding (Like 'UTF-8'), if binary , the encoding is binary When the payload is encrypted, the encoding should be the encoding of the unencrypted payload. If the payload type is not known, or not disclosed, the value is passthrough" }, { "name": "debug", "in": "header", "type": "integer", "format": "int32", "description": "Logs all requests if set in debug mode 0 - Don't debug 1 - Debug mode" }, { "name": "retryNumber", "in": "header", "type": "integer", "format": "int32", "description": "Attempts made by calling service to read content" }, { "name": "Cache-Control", "in": "header", "type": "string", "format": "string", "description": "Recommended caching time for services to expire (When data should be refreshed. ) (When data should be refreshed. ) The directives can be used max-age, s-max-age, private/public, no-cache, no-store, must-revalidate, proxy-revalidate" }, { "name": "x-forwarded-for", "in": "header", "type": "string", "format": "string", "description": "This holds client IP address send by netscaler" } ], "responses": { "200": { "description": "The requested operation role is approved", "schema": { "$ref": "#/definitions/refreshResponseBody" }, "headers": { "version": { "type": "integer", "format": "int32", "description": "The version of this message format." }, "transactionID": { "type": "string", "format": "string", "description": "An unique identifier for a set of messages belonging to each other. Can be null if t here is no transaction ID attached to this message. Identifier is defined as ___UUID for example" }, "messageID": { "type": "string", "format": "string", "description": "Unique identifier for this message. This is similar to the Mule ESB MessageID who would use this id internally. The message ID should only exist for the message between two systems, so a stream over three components will use two messageIDs one for component A to B and one from B to C. This value cannot be set by the caller." }, "currentSystem": { "type": "string", "format": "string", "description": "System that generated the message" }, "userInitiatingRequest": { "type": "string", "format": "string", "description": "User requesting/submitting information Login ID" }, "sequenceID": { "type": "string", "format": "string", "description": "Unique identifier for a sequence of messages. When null the message is not part of a sequence, if not null, the sequence number should be non 0" }, "sequenceNumber": { "type": "integer", "format": "int32", "description": "0,> for messages that are split up but need to be processed in order. When 0 this message is not part of a sequence. When not 0 the SequenceID is mandatory" }, "creationTimestamp": { "type": "string", "format": "date-time", "description": "Date of creation of the message in YYYY-MM-DD hh:mm:ss:ms in NZDT" }, "auditCategory": { "type": "string", "format": "string", "description": "Holds a string that can be used to collect log information over all services." }, "payloadEncrypted": { "type": "boolean", "format": "boolean", "description": "If true the payload is encrypted, when false it is not. This is set for the content encryption(like GPG), not the connection (like SSL)" }, "payloadEncoding": { "type": "string", "format": "string", "description": "When the payload is text, it should contain the text encoding (Like 'UTF-8'), if binary , the encoding is binary When the payload is encrypted, the encoding should be the encoding of the unencrypted payload. If the payload type is not known, or not disclosed, the value is passthrough" }, "debug": { "type": "integer", "format": "int32", "description": "Logs all requests if set in debug mode 0 - Don't debug 1 - Debug mode" }, "retryNumber": { "type": "integer", "format": "int32", "description": "Attempts made by calling service to read content" }, "Cache-Control": { "type": "string", "format": "string", "description": "Recommended caching time for services to expire (When data should be refreshed. ) (When data should be refreshed. ) The directives can be used max-age, s-max-age, private/public, no-cache, no-store, must-revalidate, proxy-revalidate" } } }, "400": { "description": "Invalid request.", "headers": { "version": { "type": "integer", "format": "int32", "description": "The version of this message format." }, "transactionID": { "type": "string", "format": "string", "description": "An unique identifier for a set of messages belonging to each other. Can be null if t here is no transaction ID attached to this message. Identifier is defined as ___UUID for example" }, "messageID": { "type": "string", "format": "string", "description": "Unique identifier for this message. This is similar to the Mule ESB MessageID who would use this id internally. The message ID should only exist for the message between two systems, so a stream over three components will use two messageIDs one for component A to B and one from B to C. This value cannot be set by the caller." }, "currentSystem": { "type": "string", "format": "string", "description": "System that generated the message" }, "userInitiatingRequest": { "type": "string", "format": "string", "description": "User requesting/submitting information Login ID" }, "sequenceID": { "type": "string", "format": "string", "description": "Unique identifier for a sequence of messages. When null the message is not part of a sequence, if not null, the sequence number should be non 0" }, "sequenceNumber": { "type": "integer", "format": "int32", "description": "0,> for messages that are split up but need to be processed in order. When 0 this message is not part of a sequence. When not 0 the SequenceID is mandatory" }, "creationTimestamp": { "type": "string", "format": "date-time", "description": "Date of creation of the message in YYYY-MM-DD hh:mm:ss:ms in NZDT" }, "auditCategory": { "type": "string", "format": "string", "description": "Holds a string that can be used to collect log information over all services." }, "payloadEncrypted": { "type": "boolean", "format": "boolean", "description": "If true the payload is encrypted, when false it is not. This is set for the content encryption(like GPG), not the connection (like SSL)" }, "payloadEncoding": { "type": "string", "format": "string", "description": "When the payload is text, it should contain the text encoding (Like 'UTF-8'), if binary , the encoding is binary When the payload is encrypted, the encoding should be the encoding of the unencrypted payload. If the payload type is not known, or not disclosed, the value is passthrough" }, "debug": { "type": "integer", "format": "int32", "description": "Logs all requests if set in debug mode 0 - Don't debug 1 - Debug mode" }, "retryNumber": { "type": "integer", "format": "int32", "description": "Attempts made by calling service to read content" }, "Cache-Control": { "type": "string", "format": "string", "description": "Recommended caching time for services to expire (When data should be refreshed. ) (When data should be refreshed. ) The directives can be used max-age, s-max-age, private/public, no-cache, no-store, must-revalidate, proxy-revalidate" }, "ErrorState": { "type": "string", "format": "string", "description": "One of UNKNOWN, OK, WARN, ERROR, FATAL" }, "ErrorType": { "type": "string", "format": "string", "description": "Specific error information." }, "ErrorOriginID": { "type": "string", "format": "string", "description": "Message ID of where error first occurred " } } }, "401": { "description": "The request failed authentication. Something is wrong with the JWT.", "headers": { "version": { "type": "integer", "format": "int32", "description": "The version of this message format." }, "transactionID": { "type": "string", "format": "string", "description": "An unique identifier for a set of messages belonging to each other. Can be null if t here is no transaction ID attached to this message. Identifier is defined as ___UUID for example" }, "messageID": { "type": "string", "format": "string", "description": "Unique identifier for this message. This is similar to the Mule ESB MessageID who would use this id internally. The message ID should only exist for the message between two systems, so a stream over three components will use two messageIDs one for component A to B and one from B to C. This value cannot be set by the caller." }, "currentSystem": { "type": "string", "format": "string", "description": "System that generated the message" }, "userInitiatingRequest": { "type": "string", "format": "string", "description": "User requesting/submitting information Login ID" }, "sequenceID": { "type": "string", "format": "string", "description": "Unique identifier for a sequence of messages. When null the message is not part of a sequence, if not null, the sequence number should be non 0" }, "sequenceNumber": { "type": "integer", "format": "int32", "description": "0,> for messages that are split up but need to be processed in order. When 0 this message is not part of a sequence. When not 0 the SequenceID is mandatory" }, "creationTimestamp": { "type": "string", "format": "date-time", "description": "Date of creation of the message in YYYY-MM-DD hh:mm:ss:ms in NZDT" }, "auditCategory": { "type": "string", "format": "string", "description": "Holds a string that can be used to collect log information over all services. " }, "payloadEncrypted": { "type": "boolean", "format": "boolean", "description": "If true the payload is encrypted, when false it is not. This is set for the content encryption(like GPG), not the connection (like SSL)" }, "payloadEncoding": { "type": "string", "format": "string", "description": "When the payload is text, it should contain the text encoding (Like 'UTF-8'), if binary , the encoding is binary When the payload is encrypted, the encoding should be the encoding of the unencrypted payload. If the payload type is not known, or not disclosed, the value is passthrough" }, "debug": { "type": "integer", "format": "int32", "description": "Logs all requests if set in debug mode 0 - Don't debug 1 - Debug mode" }, "retryNumber": { "type": "integer", "format": "int32", "description": "Attempts made by calling service to read content" }, "Cache-Control": { "type": "string", "format": "string", "description": "Recommended caching time for services to expire (When data should be refreshed. ) (When data should be refreshed. ) The directives can be used max-age, s-max-age, private/public, no-cache, no-store, must-revalidate, proxy-revalidate" }, "ErrorState": { "type": "string", "format": "string", "description": "One of UNKNOWN, OK, WARN, ERROR, FATAL" }, "ErrorType": { "type": "string", "format": "string", "description": "Specific error information." }, "ErrorOriginID": { "type": "string", "format": "string", "description": "Message ID of where error first occurred " } } }, "403": { "description": "The requested operation role is denied.", "headers": { "version": { "type": "integer", "format": "int32", "description": "The version of this message format." }, "transactionID": { "type": "string", "format": "string", "description": "An unique identifier for a set of messages belonging to each other. Can be null if t here is no transaction ID attached to this message. Identifier is defined as ___UUID for example" }, "messageID": { "type": "string", "format": "string", "description": "Unique identifier for this message. This is similar to the Mule ESB MessageID who would use this id internally. The message ID should only exist for the message between two systems, so a stream over three components will use two messageIDs one for component A to B and one from B to C. This value cannot be set by the caller." }, "currentSystem": { "type": "string", "format": "string", "description": "System that generated the message" }, "userInitiatingRequest": { "type": "string", "format": "string", "description": "User requesting/submitting information Login ID" }, "sequenceID": { "type": "string", "format": "string", "description": "Unique identifier for a sequence of messages. When null the message is not part of a sequence, if not null, the sequence number should be non 0" }, "sequenceNumber": { "type": "integer", "format": "int32", "description": "0,> for messages that are split up but need to be processed in order. When 0 this message is not part of a sequence. When not 0 the SequenceID is mandatory" }, "creationTimestamp": { "type": "string", "format": "date-time", "description": "Date of creation of the message in YYYY-MM-DD hh:mm:ss:ms in NZDT" }, "auditCategory": { "type": "string", "format": "string", "description": "Holds a string that can be used to collect log information over all services. " }, "payloadEncrypted": { "type": "boolean", "format": "boolean", "description": "If true the payload is encrypted, when false it is not. This is set for the content encryption(like GPG), not the connection (like SSL)" }, "payloadEncoding": { "type": "string", "format": "string", "description": "When the payload is text, it should contain the text encoding (Like 'UTF-8'), if binary , the encoding is binary When the payload is encrypted, the encoding should be the encoding of the unencrypted payload. If the payload type is not known, or not disclosed, the value is passthrough" }, "debug": { "type": "integer", "format": "int32", "description": "Logs all requests if set in debug mode 0 - Don't debug 1 - Debug mode" }, "retryNumber": { "type": "integer", "format": "int32", "description": "Attempts made by calling service to read content" }, "Cache-Control": { "type": "string", "format": "string", "description": "Recommended caching time for services to expire (When data should be refreshed. ) (When data should be refreshed. ) The directives can be used max-age, s-max-age, private/public, no-cache, no-store, must-revalidate, proxy-revalidate" }, "ErrorState": { "type": "string", "format": "string", "description": "One of UNKNOWN, OK, WARN, ERROR, FATAL" }, "ErrorType": { "type": "string", "format": "string", "description": "Specific error information." }, "ErrorOriginID": { "type": "string", "format": "string", "description": "Message ID of where error first occurred " } } } } } } }, "definitions": { "errorModel": { "type": "object", "properties": { "errors": { "type": "array", "items": { "description": "An array of error items containing error codes and descriptions. Note that the error descriptions will be normalised.", "properties": { "code": { "type": "integer", "format": "int32", "description": "An error code - should be used in conjunction with the HTTP response code." }, "description": { "type": "string", "description": "A short description of the error." } } } }, "_links": { "type": "array", "items": { "properties": { "rel": { "type": "string", "description": "The relationship to the request e.g. self which contains the resource that was requested or {object name}, a link to a resource that is related to the requested resource" }, "href": { "type": "string", "description": "A link to the related resource. In an error scenario this is likely to be something such as a link to a support portal." } } } } } }, "refreshRequestBody": { "type": "object", "required": [ "refreshJwt" ], "properties": { "refreshJwt": { "type": "string", "title": "The RefreshJwt Schema ", "default": "" } } }, "refreshResponseBody": { "type": "object", "properties": { "accessJwt": { "type": "string", "title": "The Accessjwt Schema ", "default": "" }, "accessExpiry": { "type": "integer", "title": "The Accessexpiry Schema ", "default": 0 }, "refreshJwt": { "type": "string", "title": "The Refreshjwt Schema ", "default": "" }, "refreshExpiry": { "type": "integer", "title": "The Refreshexpiry Schema ", "default": 0 }, "errors": { "$ref": "#/definitions/errorModel/properties/errors" }, "_links": { "$ref": "#/definitions/errorModel/properties/_links" } } } } }