Created
September 1, 2022 16:37
-
-
Save dylanyoung-dev/021d15d6662bca74635624c474a72866 to your computer and use it in GitHub Desktop.
Kill Session Postman Collection (Sitecore CDP + Personalize)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"info": { | |
"_postman_id": "85925933-40b8-4564-9dcb-f212b9c11107", | |
"name": "Kill Session", | |
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", | |
"_exporter_id": "18869027" | |
}, | |
"item": [ | |
{ | |
"name": "Kill Session", | |
"event": [ | |
{ | |
"listen": "prerequest", | |
"script": { | |
"exec": [ | |
"var browserId = pm.environment.get(\"BrowserRef\");\r", | |
"var POS = pm.environment.get(\"POS\");\r", | |
"var clientKey = pm.environment.get(\"ClientKey\");\r", | |
"var closeSessionRequest = {\r", | |
" channel: \"WEB\",\r", | |
" language: \"EN\",\r", | |
" currency: \"USD\",\r", | |
" pos: POS,\r", | |
" browser_id: browserId,\r", | |
" clientKey: clientKey,\r", | |
" type: \"FORCE_CLOSE\",\r", | |
" _bx_extended_message: \"1\"\r", | |
"};\r", | |
"\r", | |
"var messageAsString = JSON.stringify(closeSessionRequest);\r", | |
"var messageEncoded = encodeURI(messageAsString);\r", | |
"pm.environment.set(\"message\", messageEncoded);" | |
], | |
"type": "text/javascript" | |
} | |
} | |
], | |
"request": { | |
"method": "GET", | |
"header": [], | |
"url": { | |
"raw": "https://{{apiEndpoint}}/v1.2/event/create.json?client_key={{ClientKey}}&message={{message}}", | |
"protocol": "https", | |
"host": [ | |
"{{apiEndpoint}}" | |
], | |
"path": [ | |
"v1.2", | |
"event", | |
"create.json" | |
], | |
"query": [ | |
{ | |
"key": "client_key", | |
"value": "{{ClientKey}}" | |
}, | |
{ | |
"key": "message", | |
"value": "{{message}}" | |
} | |
] | |
} | |
}, | |
"response": [] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment