Need help sending a cURL request to the Cloudflare API

Hello, I need help setting up Authenticated Origin Pulls. I am on the last step of https://developers.cloudflare.com/ssl/origin-configuration/authenticated-origin-pull/set-up/zone-level/ and am stuck on how to use cURL to enable it. Thanks!
Zone-level authenticated origin pulls · Cloudflare SSL/TLS docs
When you enable Authenticated Origin Pulls for a zone, all proxied traffic to your zone is authenticated at the origin web server.
4 Replies
zegevlier
zegevlier2y ago
You need to send the request listed at https://developers.cloudflare.com/api/operations/zone-level-authenticated-origin-pulls-set-enablement-for-zone (under the link at the PUT). Where are you stuck on this?
b-bear
b-bearOP2y ago
Just sending the request. It says “invalid uri” when I copy the link I mean request
Chaika
Chaika2y ago
Did you change the zone identifider to your zone id? Here's a more full example using Global API Keys
curl -sX PUT https://api.cloudflare.com/client/v4/zones/$zoneid/origin_tls_client_auth/settings -H "X-Auth-Email: $cf_email" -H "X-Auth-Key: $cf_key" -H "Content-Type: application/json" -d $(echo "{\"enabled\":true}")
curl -sX PUT https://api.cloudflare.com/client/v4/zones/$zoneid/origin_tls_client_auth/settings -H "X-Auth-Email: $cf_email" -H "X-Auth-Key: $cf_key" -H "Content-Type: application/json" -d $(echo "{\"enabled\":true}")
b-bear
b-bearOP2y ago
I got it to work and the status is now “enabled” Will this also work for www.

Did you find this page helpful?