...
GEThttps://<atlassian-product-base-url>/rest/ksso/api/snapshot/1.0/config/snapshot/
Returns a list of available snapshots like
Code Block | ||
---|---|---|
| ||
[ { "applicationName": "JIRA", "applicationVersion": "8.16.1", "pluginVersion": "5.2.1-SNAPSHOT", "baseUrl": "https://elisor-p1:8443/jira", "timeMillis": 1641298623998, "description": "test", "filename": "sso-snapshot-2022-01-04-13_17_04.zip", "id": "sso-snapshot-2022-01-04-13_17_04", "readable": true }, { "applicationName": "JIRA", "applicationVersion": "8.16.1", "pluginVersion": "5.2.1-SNAPSHOT", "baseUrl": "https://elisor-p1:8443/jira", "timeMillis": 1641224273947, "description": "Backup before upgrade of config from version [unknown version] to 5.2.1-SNAPSHOT", "filename": "sso-snapshot-2022-01-03-16_37_53.zip", "id": "sso-snapshot-2022-01-03-16_37_53", "readable": true } ] |
...
rest/ksso/api/apitokens/3.0/user/tokens
as an admin user
resulting in:
Code Block | ||
---|---|---|
| ||
{"allApiTokens": [ { "createdAt": "2022-01-05T08:41:31", "createdAtMillis": 1641368491561, "tokenName": "non-expiring", "description": "Longer free-text optional description about the token's purpose", "id": 130, "expiresAt": "Never", "username": "admin" }, { "timeUntilExpiryDays": "29", "createdAt": "2022-01-05T08:41:02", "createdAtMillis": 1641368462114, "timeUntilExpiryMillis": 2586019515, "tokenName": "non-expiring2", "description": "Longer free-text optional description about the token's purpose", "expiresAt": "2022-02-04T08:41", "username": "admin" }, { "timeUntilExpiryDays": "179", "createdAt": "2022-01-04T18:00:42", "createdAtMillis": 1641315642318, "timeUntilExpiryMillis": 15493199718, "description": "Google drive service", // Due to a bug in 5.7.0, this field is actually the token name "id": 98, "expiresAt": "2022-07-03T19:00", "username": "john.doe" }, { "timeUntilExpiryDays": "29", "createdAt": "2022-01-04T18:00:20", "createdAtMillis": 1641315620320, "timeUntilExpiryMillis": 2533177720, "tokenName": "User token 1", "description": "Longer free-text optional description about the token's purpose", "id": 97, "expiresAt": "2022-02-03T18:00", "username": "john.doe" }, ... ]} |
...
Logged in user john.doe gives all the tokens belonging to john.doe:
Code Block | ||
---|---|---|
| ||
[ { "timeUntilExpiryDays": "179", "createdAt": "2022-01-04T18:00:42", "createdAtMillis": 1641315642318, "timeUntilExpiryMillis": 15493838324, "tokenName": "Google drive service", "description": "Longer free-text optional description about the token's purpose", "id": 98, "expiresAt": "2022-07-03T19:00", "username": "john.doe" }, { "timeUntilExpiryDays": "29", "createdAt": "2022-01-04T18:00:20", "createdAtMillis": 1641315620320, "timeUntilExpiryMillis": 2533816318, "tokenName": "User token 1", "description": "Longer free-text optional description about the token's purpose", "id": 97, "expiresAt": "2022-02-03T18:00", "username": "john.doe" } ] |
...
With request body to create token with custom description and duration
Code Block language json { "tokenName": "Example name", "description":"Longer free-text optional description about the token's purpose", "validForDays":"180" }
resulting in HTTP 201:
Code Block language json { "validForDays": "180", "expiresAt": "2022-07-03T18:27", "apiToken": "YXPTJ2N52YYDDMKDHVYMQW2R7J7KMCJHQMDMUELXPKWDTR4QGRPKKS5BYTAPYAKBCMKKAMF2G3B6ATA2CVN3RWAFJX22MJEWC6QU2HTQIFJ4MVA4LOHS2ZKZ6OP3DKGR", "tokenName": "Example name", "description":"Longer free-text optional description about the token's purpose", "id": 67, "expiresAtMillis": 1656865644754 }
With empty JSON body for default values
{}resulting in HTTP 201:
Code Block language json { "validForDays": "30", "expiresAt": "2022-02-03T17:29", "apiToken": "UEBDRPDHDWL4UKZS6DADIKTBU2WAULTDMR2NL2M2EPTKWMES2LHGISUBP7LRZUQ5N6VAT5LHJS3ZGEI7O2AASCC5BC52RC5YDP4QI76BU4GVEGKEAMKZQ73B234O3GF7", "tokenName": "api_token_2022-01-04T17:29:02.042", "description": "", "id": 68, "expiresAtMillis": 1643905742042 }
With validForever for non-expiring token
Code Block language json { "tokenName": "Example name", "description":"Longer free-text optional description about the token's purpose", "isValidForever":true }
resulting in HTTP 201:
Code Block language json { "apiToken": "64MVETBSHR7GFUXYCAPGPSERMOSKLLOQJHCVRXOYHWHGNUUZGUEDJFRARWCBPUZLXCNLZERXUCSB4D3H4TNSFTFY34C5IHEDILN7RXXNL6B2YVT4P7VBBE4RK7VMDZIO", "validForDays": "Forever", "tokenName": "Example name", "description":"Longer free-text optional description about the token's purpose", "id": 130, "expiresAt": "Never" }
...