Hi, I’m new to Cloudflare and am getting Authentication errors when I make a POST request to upload an image. Here is my request code:
requestImageUploadLink clientId =
Effect.Http.request
{ url = "https://api.cloudflare.com/client/v4/accounts/" ++ Env.cloudFlareAccountId ++ "/images/v2/direct_upload"
, headers =
[ Effect.Http.header "Authorization" ("Bearer " ++ Env.cloudFlareAPIKey) ]
, method = "POST"
, timeout = Nothing
, tracker = Nothing
, body = Effect.Http.emptyBody
, expect = Effect.Http.expectJson Types.GotCloudFlareUrlDataPlus (oneTimeUrlDecoder clientId)
}
I’ve double-checked both the API key and the Account ID. The response from the request is
{"success":false,"errors":[{"code":10000,"message":"Authentication error"}]}