Why does the UUID for Variables change every API request to a Collection?

Making API requests to “https://api.getpostman.com” using the “X-Api-Key” header and asking for a specific collection such as:

    curl --location -g --request GET 'https://api.getpostman.com/collections/{{collection_uid}}' \
--header 'X-Api-Key: XXXX'

I notice that in-between requests that the UUID is changing that are referenced by variables:

         "variable": [
             {
-                "id": "1a413276-0b40-4344-a4ee-41d88a8304cc",
+                "id": "8bd5186a-74f6-4f89-b286-2859ccf8e35a",
                 "key": "authToken",
                 "value": ""
             },
             {
-                "id": "fb414a84-0c44-4f70-b7ea-b3df8a4b1c0c",
+                "id": "532da9b0-4923-4616-9ca5-019fdae6695b",
                 "key": "tokenId",
                 "value": ""
             },
             {
-                "id": "128208f5-fc37-4858-948d-b1a97e1692c5",
+                "id": "e613c352-008a-40a6-8118-a220abf776da",
                 "key": "userEmail",
                 "value": ""
             },
             {
-                "id": "e907e5aa-5fe9-4d09-ba5d-c86369eed96f",
+                "id": "1f38a783-7f91-4870-88d0-8f677de32c33",
                 "key": "userPassword",
                 "value": ""
             }

This is the only thing that changes and it changes every request. I can not find a logical reasoning as to why. I am saving contents of the results from the requests for Collections locally and committing them to git. With the UUID for Variables changing every request this will always yield to a difference and subsequent drift from what is in the repository. My question is is there a way to either stop this behavior or sanitize these differences so they are consistent across API requests (e.g. is there a query parameter I can pass to the API to strip out the id field for Variables etc.)?

1 Like

I would have thought others have encountered this or a Postman core developer might know the reasoning behind this or to circumvent this behavior. Each successive API request results in a unique entity being spit out by the API and thus creates problems for committing these results to source control. Bump! If anyone could shed some insight it would be very helpful!

@johnwyles can you confirm, every time you GET a collection using the Postman API, the collection variable id changes?

Yes, every request results in a different UUID:

curl --location -g --request GET 'https://api.getpostman.com/collections/abcd-abcd-dddd-42ac-ab61-abcd' --header 'X-Api-Key: PMAK-abcd-abcd' | jq
    "variable": [
      {
        "id": "29217a0f-36d2-4ca8-8a2e-ae67afd42118",
        "key": "authToken",
        "value": ""
      },
curl --location -g --request GET 'https://api.getpostman.com/collections/abcd-abcd-dddd-42ac-ab61-abcd' --header 'X-Api-Key: PMAK-abcd-abcd' | jq
    "variable": [
      {
        "id": "f76e64ac-962c-41b3-a339-0138e2a61e43",
        "key": "authToken",
        "value": ""
      },

Hi @johnwyles,
I replicated it and I also see the UUID for the variables being variable :stuck_out_tongue:

Hey @johnwyles,
This is definitely a bug, could you raise it here - Issues · postmanlabs/postman-app-support · GitHub so that it gets visibility and the engineering team can work on fixing it?

I have filed this issue: UUID for Variables change every API request to a Collection · Issue #9885 · postmanlabs/postman-app-support · GitHub

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.