Creating tokens from Maximo API
About this task
This section provides information and an example for issuing
tokens. Issuing API requires type and customer
fields in JSON payload. expirationdate field is optional, used a
default expiration date when the value is null.
Note: Each field needs
spi: prefix when you specify lean=0 in URL parameters for
example spi:type. Payload attributes:
| Name | Value | Note |
|---|---|---|
| Type | JWTBASIC | |
| Customer | Customer Tenant ID | |
| Expirationdate | Expiration Date Time | Optional.Advanced Authentication only. |
Request:
POST /maximo/oslc/cvapitoken?lean=1 HTTP/1.1
Host: <customer-id>.automotive.internetofthings.ibmcloud.com:443
maxauth: <Base64 code of username:password for {{site.data.keyword.maximoam_short}}>
Content-Type: application/json
Cache-Control: no-cache
{
"type": "JWT",
"customer": "CUSTMER1",
"expirationdate": "2019-07-14T16:33:57+00:00"
}Response:
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-cache
{
"createddate": "2019-02-21T08:56:57+00:00",
"expirationdate": "2019-07-14T16:33:57+00:00",
"customer": "CUSTOMER1",
"token": "eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiI1cVJHeEJfQXVVN2ptaE50Wnd6
dTBBIiwic3ViIjoiSW9UIENvbm5lY3RlZCBWZWhpY2xlIEluc2lnaHRzIiwiaXNzIjo
iQ0YgVEVTVCIsImlhdCI6MTU1MDczOTQxNywiZXhwIjoxNTYzMTIyMDM3fQ.K-FGpO7
9IpEC0AyPA5_CBBUF_GEkSOL_r8qQ5Ld7eETrXxKZHpiq9rqoFrZ7uiusuzMzsz_aUJ
VEpBvBTVxFAg"
}