{
	"info": {
		"_postman_id": "3f7fbc1e-b728-439f-9615-f4ba2689cf0b",
		"name": "* Sensedia Authorization <token>",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "19755013"
	},
	"item": [
		{
			"name": "Access token (client-credentials <Oauth RFC 6749>)",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"//GET 'access_token' = 'client-id:access-token' (base64)\r",
							"const body = JSON.parse(responseBody);\r",
							"var accessTokenBase64 = body.access_token;\r",
							"postman.setEnvironmentVariable(\"access_token\", accessTokenBase64);\r",
							"\r",
							"//GET only 'access_token' (no base64)\r",
							"var decodeBase64 = atob(accessTokenBase64);\r",
							"const accessTokenDecode = decodeBase64.split(':')[1];\r",
							"postman.setEnvironmentVariable(\"access_token_decode\", accessTokenDecode);\r",
							"\r",
							"//tests[\"client-id:access-token Base64 => \" + accessTokenBase64] = true;\r",
							"tests[\"          access-token decode => \" + accessTokenDecode] = true;"
						],
						"type": "text/javascript",
						"packages": {}
					}
				}
			],
			"request": {
				"auth": {
					"type": "basic",
					"basic": [
						{
							"key": "password",
							"value": "{{client_secret}}",
							"type": "string"
						},
						{
							"key": "username",
							"value": "{{client_id}}",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/x-www-form-urlencoded"
					}
				],
				"body": {
					"mode": "urlencoded",
					"urlencoded": [
						{
							"key": "grant_type",
							"value": "client_credentials",
							"type": "text"
						}
					]
				},
				"url": {
					"raw": "{{baseUrl}}/oauth2/v1/access-token",
					"host": [
						"{{baseUrl}}"
					],
					"path": [
						"oauth2",
						"v1",
						"access-token"
					]
				}
			},
			"response": []
		}
	]
}