Call to API App install failing
-
Hello,
I am testing my Cloudron install with API calls.
When I try the invoke install app, I am getting a "Bad Request " and I cannot figure out what is wrong with my call, any idea?
curl -X POST https://my.smthg.com/api/v1/apps/install?access_token=<removed> 26dad6909df7c716ff -d '{"appStoreId": "io.n8n.cloudronapp@2.37.0","subdomain": "workflow","domain": "smthg.com","accessRestriction": "null"}'returns
{
"status": "Bad Request",
"message": "appStoreId or manifest is required"
}
I first ran, and captured, the install directly from the GUI to validate the parameters, then removed the new app.
Cheers
Pierre -
N nebulon marked this topic as a question on
-
Hello,
I am testing my Cloudron install with API calls.
When I try the invoke install app, I am getting a "Bad Request " and I cannot figure out what is wrong with my call, any idea?
curl -X POST https://my.smthg.com/api/v1/apps/install?access_token=<removed> 26dad6909df7c716ff -d '{"appStoreId": "io.n8n.cloudronapp@2.37.0","subdomain": "workflow","domain": "smthg.com","accessRestriction": "null"}'returns
{
"status": "Bad Request",
"message": "appStoreId or manifest is required"
}
I first ran, and captured, the install directly from the GUI to validate the parameters, then removed the new app.
Cheers
Pierre@plm27
Example fetched directly from the browser when installing an app:curl 'https://my.DOMAIN.TLD/api/v1/apps/install' -X POST -H 'Authorization: Bearer REDACTED-TOKEN' -H 'Content-Type: application/json;charset=utf-8' --data-raw '{"appStoreId":"io.hackmd.cloudronapp@1.16.1","subdomain":"hdoc","domain":"DOMAIN.TLD","secondaryDomains":{},"portBindings":{},"accessRestriction":{"users":[],"groups":[]},"cert":null,"key":null,"overwriteDns":false}'This execute with to correct values for the Domain and Token returns:
"id": "461ea9bb-ed4e-4d19-8e13-dea542e5b19a", "taskId": "2441" }Your
?access_tokenseams odd, I always used bearer token auth. -
Hi Nebulon,
Thx, that should be it. I didn't pick up that I forgot the header.
Testing and reverting.@nebulon, @BrutalBirdie
Thx to both of you, the call is now working.
curl -kX POST -H "Content-Type: application/json" https://my.smthg.com/api/v1/apps/install?access_token=857f7d7eb583cfb951e5a50c75a762b94304d4ba50d4a0c94950643eaab7959a -d '{"appStoreId": "io.n8n.cloudronapp@2.37.0","subdomain": "workflow","domain": "somethg.com","accessRestriction": {"users":[],"groups":[]}}'
{
"id": "c6c79d78-7c7c-414b-acf7-8b5cc39370ed",
"taskId": "269"
}It needed obviously the header, but also I thought reading the API specs that accessRestriction could be null. It is not the case, so I used @BrutalBirdie assignment (empty users and groups) and the call succeeded.
Once again thank you very much. -
G girish has marked this topic as solved on
-
L livingstonlarus referenced this topic on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login