Thoride
Thoride
AArduino
Created by Thoride on 5/31/2025 in #coding-help
Accessing arduino cloud api via python giving error 405
Hi all! I'm trying to access my arduino cloud via the python api. I tried following the tutorial in the docs at https://docs.arduino.cc/arduino-cloud/api/arduino-iot-api/ however when I use the script they suggest on there it get an error 405 with reason: Method Not Allowed. (see full stacktrace below). I've checked my api keys and even making the same request through postman which all seems to work fine (mostly). I do have an organization so im wondering if the issue is because theres no clarification for personal vs org account but i'm not entirely sure how i'd add that. I can add the python code if you're curious (its essentially the copy paste from the website). Thanks in advance! Stacktrace:
Exception when calling ThingsV2Api->list_things: (405)
Reason: Method Not Allowed
HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/vnd.goa.error+json', 'Content-Length': '141', 'Connection': 'keep-alive', 'Date': 'Sat, 31 May 2025 23:45:42 GMT', 'Vary': 'Origin', 'Allow': 'OPTIONS', 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Expires': '0', 'Pragma': 'no-cache', 'X-Cache': 'Error from cloudfront', 'Via': '1.1 da745b01c27611dac38d175371cb7b54.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'DEN53-P2', 'X-Amz-Cf-Id': 'OFYJ8LmFIvLVooTXoYKu52oexBpmjJ9BTyVpXrTbvWdTeVg3TgqXpg=='})
HTTP response body: {"id":"hupCnj98","code":"method_not_allowed","status":405,"detail":"Method GET must be OPTIONS","meta":{"allowed":"OPTIONS","method":"GET"}}
Exception when calling ThingsV2Api->list_things: (405)
Reason: Method Not Allowed
HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/vnd.goa.error+json', 'Content-Length': '141', 'Connection': 'keep-alive', 'Date': 'Sat, 31 May 2025 23:45:42 GMT', 'Vary': 'Origin', 'Allow': 'OPTIONS', 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Expires': '0', 'Pragma': 'no-cache', 'X-Cache': 'Error from cloudfront', 'Via': '1.1 da745b01c27611dac38d175371cb7b54.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'DEN53-P2', 'X-Amz-Cf-Id': 'OFYJ8LmFIvLVooTXoYKu52oexBpmjJ9BTyVpXrTbvWdTeVg3TgqXpg=='})
HTTP response body: {"id":"hupCnj98","code":"method_not_allowed","status":405,"detail":"Method GET must be OPTIONS","meta":{"allowed":"OPTIONS","method":"GET"}}
5 replies