In our CICD pipeline, we use api requests to retrieve the relevant Collections to run through our tests. Therefore we do first a GET on the collections and do a GET on all collections to retrieve the content as JSON so we can run it with Newman.
Unfortunately, not all collections we get back do return a correct content. For example:
(anonymized with #)
curl -X GET \
https://api.getpostman.com/collections \
-H 'X-Api-Key: #############################'
result:
{
"collections": [
{
"id": "######-####-####-####-#######001",
"name": "Collection ABC",
"owner": "#######",
"uid": "######-####-####-####-#######001"
},
{
"id": "######-####-####-####-#######002",
"name": "Collection DEF",
"owner": "#######",
"uid": "######-####-####-####-#######002"
},
{
"id": "######-####-####-####-#######003",
"name": "Collection XYZ",
"owner": "#######",
"uid": "######-####-####-####-#######003"
}
}
When I do a get of Collection ABC and DEF, it returns a correct JSON. But when I do a get on Collection XYZ, I get the message:
curl -X GET \
https://api.getpostman.com/collections/######-####-####-####-#######003 \
-H 'X-Api-Key: #############################'
{
"error": {
"name": "instanceNotFoundError",
"message": "Instance not found in the database."
}
}
It is reproducible for this and some other collections. Even when I make changes to their name or content. What am I doing wrong?