APIGEE X - Error while creating APP using Organisation API - Invalid UUID String

Hello Members,

I am trying to create APP using organization (management APIs) in apigee x. I am trying this is gcloud using curl command in my windows laptop. My request is below 

curl -X POST -H "Authorization: Bearer <TOKEN>" -H "Content-type:application/json" --data "{\"appId\": \"myapp\",\"developerId\":\"964c4484-648f-4348-a399-511e75a12ab5\"}" "https://apigee.googleapis.com/v1/organizations/{org_name}/developers/{email ID}/apps"

And I always get error

{
"error": {
"code": 500,
"message": "Invalid UUID string: myapp",
"status": "INTERNAL",
"details": [
{
"@type": "type.googleapis.com/google.rpc.PreconditionFailure",
"violations": [
{
"subject": "[2002:a17:531:a5c4::]:4283:elbwh23:9853:368601:73915457",
"description": "Invalid UUID string: myapp"
}
]
},
{
"@type": "type.googleapis.com/google.rpc.RequestInfo",
"requestId": "14863236103221363406"
}
]
}
}

Any advice where I am making mistake ?

Kind Regards

Arijit

Solved Solved
0 2 178
1 ACCEPTED SOLUTION

You're using curl directly against the management API. The issue is due to the payload you're sending.

Firstly, don't set an appid, this will be generated by Apigee and it's a UUID that will be generated. 

Secondly, you don't need to set the developerId, it already knows which developer it belongs to from the path and it will add this automatically too.

You're missing the name attribute, and you may want to review other attributes available.

https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.developers.apps#Dev...

 

At minimum, this should work

--data '{"name":"myapp"}'

View solution in original post

2 REPLIES 2

You're using curl directly against the management API. The issue is due to the payload you're sending.

Firstly, don't set an appid, this will be generated by Apigee and it's a UUID that will be generated. 

Secondly, you don't need to set the developerId, it already knows which developer it belongs to from the path and it will add this automatically too.

You're missing the name attribute, and you may want to review other attributes available.

https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.developers.apps#Dev...

 

At minimum, this should work

--data '{"name":"myapp"}'

Many thanks. It helped