I’m trying to get strapi to trigger a re-deploy of my app using DigitalOcean’s API.
Specifically I’m using the https://api.digitalocean.com/v2/apps/{app-id}/deployments POST endpoint but although I can authenticate correctly the request is rejected for some reason. It appears Strapi is sending a body along with the request which DigitalOcean rejects. Below is the error message I receive back from DigitalOcean.
{ statusCode: 400, message: "{\"id\":\"invalid_argument\",\"message\":\"unknown field \\\"event\\\" in apps.CreateDeploymentRequest\"}\n" }
Has anyone managed to get this working?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello,
Does this work if you try to run the following POST request using curl directly:
curl \
-H "Content-Type: application/json" \
-H "Authorization: Bearer TOKEN" \
"https://api.digitalocean.com/v2/apps/<app_id>/deployments" \
-XPOST \
-d '{"force_build": true}
Best,
Bobby
Having the exact same issue with another CMS (Hygraph) and webhooks.
It seems that when a webhook is triggered by an external source (CMS, Zapier, other server etc) the apps.CreateDeploymentRequest fails because the external source will usually pass along some other data i.e Hygraph passes the following…
{
"operation": "publish",
"data": {
"__typename": "Page",
"id": "clblk3v8909xv0b2o3s95k8l4",
"stage": "PUBLISHED"
}
}
and i receive the following reply from digital oceans API
"{\"id\":\"invalid_argument\",\"message\":\"unknown field \\\"operation\\\" in apps.CreateDeploymentRequest\"}\n"
This seems like a fairly serious issue with Digital Ocean webhooks
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.