{
	"info": {
		"_postman_id": "8d5b8a2e-c231-404c-a49e-a8ef5638b856",
		"name": "91_PP_Account_Auth Customer Collection",
		"description": "# Parcel DE Authentication \n\nThis is a collection suitable for customer testing and onboarding. It will exercise the most important calls using DHL's sandbox environment. \n\n## HOWTO\n\n1. Load this collection into Postman\n2. Update a few collection variables which have been provided to you during onboarding.\n\nPlease look into the \"Variables\" of the collection and add your specific client_id\n as collection variable. Also add your client_secret.\n\n3. You can now use the collection. There is no additional configuration required.",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"item": [
		{
			"name": "Get Version",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"pm.test(\"Status code is 200\", function () {\r",
							"    pm.response.to.have.status(200);\r",
							"});"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"auth": {
					"type": "noauth"
				},
				"method": "GET",
				"header": [],
				"url": {
					"raw": "https://{{host}}/{{basepath}}",
					"protocol": "https",
					"host": [
						"{{host}}"
					],
					"path": [
						"{{basepath}}"
					]
				}
			},
			"response": []
		},
		{
			"name": "Get Token",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"pm.test(\"GKP GetToken: Status code is 200\", function () {\r",
							"    pm.response.to.have.status(200);\r",
							"})\r",
							"\r",
							"let j = pm.response.json();\r",
							"x = j.access_token;\r",
							"pm.collectionVariables.set(\"access_token\", x);\r",
							""
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"auth": {
					"type": "noauth"
				},
				"method": "POST",
				"header": [],
				"body": {
					"mode": "urlencoded",
					"urlencoded": [
						{
							"key": "grant_type",
							"value": "password",
							"type": "default"
						},
						{
							"key": "client_id",
							"value": "{{client_id}}",
							"type": "default"
						},
						{
							"key": "username",
							"value": "{{gkpuser}}",
							"type": "default"
						},
						{
							"key": "password",
							"value": "{{gkppass}}",
							"type": "default"
						},
						{
							"key": "client_secret",
							"value": "{{client_secret}}",
							"type": "default"
						}
					]
				},
				"url": {
					"raw": "https://{{host}}/{{basepath}}/token",
					"protocol": "https",
					"host": [
						"{{host}}"
					],
					"path": [
						"{{basepath}}",
						"token"
					]
				}
			},
			"response": []
		},
		{
			"name": "Hello",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"pm.test(\"GKP GetToken: Status code is 200\", function () {\r",
							"    pm.response.to.have.status(200);\r",
							"})\r",
							"\r",
							""
						],
						"type": "text/javascript"
					}
				}
			],
			"protocolProfileBehavior": {
				"disableBodyPruning": true
			},
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{access_token}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"body": {
					"mode": "urlencoded",
					"urlencoded": []
				},
				"url": {
					"raw": "https://{{host}}/{{basepath}}/hello",
					"protocol": "https",
					"host": [
						"{{host}}"
					],
					"path": [
						"{{basepath}}",
						"hello"
					]
				}
			},
			"response": []
		},
		{
			"name": "Hello Basic Auth",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"pm.test(\"Status code is 200\", function () {\r",
							"    pm.response.to.have.status(200);\r",
							"});"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"auth": {
					"type": "basic",
					"basic": [
						{
							"key": "password",
							"value": "gkppass",
							"type": "string"
						},
						{
							"key": "username",
							"value": "gkpuser",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [
					{
						"key": "dhl-api-key",
						"value": "{{client_id}}",
						"type": "default"
					}
				],
				"url": {
					"raw": "https://{{host}}/{{basepath}}/hello",
					"protocol": "https",
					"host": [
						"{{host}}"
					],
					"path": [
						"{{basepath}}",
						"hello"
					]
				}
			},
			"response": []
		}
	],
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		}
	],
	"variable": [
		{
			"key": "client_id",
			"value": "CHANGE_ME",
			"type": "default"
		},
		{
			"key": "client_secret",
			"value": "CHANGE_ME",
			"type": "default"
		},
		{
			"key": "host",
			"value": "api-sandbox.dhl.com",
			"type": "default"
		},
		{
			"key": "basepath",
			"value": "parcel/de/account/auth/ropc/v1",
			"type": "default"
		},
		{
			"key": "gkpuser",
			"value": "user-valid",
			"type": "default"
		},
		{
			"key": "gkppass",
			"value": "SandboxPasswort2023!",
			"type": "default"
		},
		{
			"key": "access_token",
			"value": "DEADBEAF",
			"type": "default"
		}
	]
}