Skip to main content
Participant
August 27, 2024
Question

Photoshop API "Oauth token is not valid"

  • August 27, 2024
  • 1 reply
  • 360 views

Hello!

I am trying to learn the Photoshop API and keep getting:

{
    "error_code": "401013",
    "message": "Oauth token is not valid"
}
 
I have deleted and created new Projects and removed and assigned the Photoshop API with new credentials several times and ensured I am pulling fresh api_keys and tokens repeatedly. I'm testing via Postman. Is there something basic I'm overlooking in my request? In Postman I've got it set as a Post method, Auth Type OAuth 2.0 with the header prefix "Bearer" set in the options even though it's not showing below in Postman's code view. I've tried manually pasting in the credentials as well as downloading the .json package for Postman from the credentials page in the project. In addition to postman, I've tried via various Node and Python scripts, including one that I had previously worked correctly with FireFly services when our company was doing a trial. This round though is just me as an individual using my individual account though. Should I be able to access this function with the Adobe Photoshop API trial in the developer console? No problem at all accessing https://image.adobe.io/pie/psdService/hello

Thank you for any advice or direction you can offer.

 

curl --location 'https: //image.adobe.io/pie/psdService/documentCreate' \
--header 'x-api-key: API_KEY' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '
{
    "options": {
        "document": {
            "height": 250,
            "width": 300,
            "resolution": 72,
            "fill": "white",
            "mode": "rgb",
            "depth": 16
        },
        "layers": [
            {
                "name": "first_layer",
                "type": "textLayer",
                "content": "This is a test",
                "bounds": {
                    "height": 4,
                    "left": 0,
                    "top": 0,
                    "width": 4
                }
            }
        ]
    },
    "outputs": [
        {
            "href": "https://s3.us-east-2.amazonaws.com/redacted/...",
            "storage": "external",
            "type": "image/vnd.adobe.photoshop"
        }
    ]
}'

 

 

This topic has been closed for replies.

1 reply

Participant
August 28, 2024

Oh nevermind! I was following the link to the url for the api call to check the status! Just needed to do a GET to that in another call. I read the other answer on this and didn't get it at first, but it finally clicked.