Invalid API token + tried python script with same token

Hi everyone! I am getting this response when I do a PUT request to this URL: “url”:“https://shop_name.myshopify.com/admin/api/2023-10/orders/{order.id}.json

I am trying to add an order tag.

I get this response.

{“status”:401,“response_body”:“{"errors":"[API] Invalid API key or access token (unrecognized login or wrong password)"}”,

I ran a python script with the same exact Admin API access token and it worked, same URL, same everything. I just wanted to get this to work as an automation and it does not work in the shopify admin workflows.

I am using this key ‘X-Shopify-Access-Token’

Does anyone have any ideas?

Any help??? I would love anything from anyone

You need to use legacyResourceId not id in URLs.

In order to output a variable, it must be enclosed in {{ }} not { }. So replace that with :

{{ order.legacyResourceId }}

For the API key, you need to create a custom app api key that has the write scopes and use the key there.