diff --git a/docs/postman/C4IT-F4SD-M42WebApi.postman_collection.json b/docs/postman/C4IT-F4SD-M42WebApi.postman_collection.json index 77f4e12..b3275eb 100644 --- a/docs/postman/C4IT-F4SD-M42WebApi.postman_collection.json +++ b/docs/postman/C4IT-F4SD-M42WebApi.postman_collection.json @@ -171,6 +171,53 @@ } ], "item": [ + { + "name": "00 User context", + "item": [ + { + "name": "get current user ID", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "const currentUser = pm.response.json();", + "const currentUserId = currentUser && currentUser.Id;", + "", + "pm.test(\"Current Matrix42 user ID is available\", function () {", + " pm.expect(currentUserId).to.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i);", + "});", + "", + "if (currentUserId) {", + " pm.collectionVariables.set(\"userId\", currentUserId);", + "}" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/api/userinfo", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "userinfo" + ] + } + } + } + ] + }, { "name": "01 Health and diagnostics", "item": [