Answered
Photoshop + Dropbox API: Call Successful, but no changes
have been trying to use a photoshop API to modify and upload files to dropbox, and I haven't gotten it to work. I get that the task is successful, but no luck with any changes. Here is all my code:
#output
{"jobId":"abcdefg","outputs":[{"input":"https://link","status":"succeeded","created":"2024-03-08T18:30:44.955Z","modified":"2024-03-08T18:30:46.924Z","_links":{"renditions":[{"href":"link","storage":"dropbox","type":"vnd.adobe.photoshop"}]}}],"_lin...}}
#This comes from this GET request:
curl "https://image.adobe.io/pie/psdService/status/31ad09ef-0e0c-4b6a-977b-991ce4517e6e" ^
-H "Authorization: Bearer %access_token%" ^
-H "x-api-key: %api_key%"
Which initially I thought had to do with the dropbox API, but I ensured to make the mode overwrite when uploading the new file. Here is my list of commands:
#get the link of the file from dropbox
curl -X POST "https://api.dropboxapi.com/2/files/get_temporary_link" ^
-H "Authorization: Bearer %dropbox_token%" ^
--header "Content-Type: application/json" ^
--data "{\"path\":\"/Gameday Generator/Base.psd\"}"
#modify the file
curl -X POST "https://image.adobe.io/pie/psdService/documentOperations" ^
-H "Authorization: Bearer %adobe_access_token%" ^
-H "x-api-key: %adobe_api_key%" ^
-H "Content-Type: application/json" ^
-d "@C:\Users\ahmad\OneDrive\Gameday Generator/Base.psd\request.json"
#upload the file
curl -X POST "https://api.dropboxapi.com/2/files/get_temporary_upload_link" ^
-H "Authorization: Bearer %dropbox_api_token%" ^
--header "Content-Type: application/json" ^
--data "{"commit_info":{\"path\":\"/Gameday Generator/Base.psd\,"mode":{".tag":"overwrite"}}}"
curl -X POST "https://api.dropboxapi.com/2/files/get_temporary_upload_link" ^
-H "Authorization: Bearer %dropbox_api_key%" ^
--header "Content-Type: application/json" ^
--data "{"commit_info":{\"path\":\"/Gameday Generator/Base.psd\,"mode":{".tag":"overwrite"}}}"
#request.json:
{
"inputs": [
{
"storage": "dropbox",
"href": "%dropbox_link%"
}
],
"options": {
"layers": [
{
"name": "Away Position",
"text": {
"contents": "Hello"
}
}
]
},
"outputs": [
{
"storage": "dropbox",
"type": "vnd.adobe.photoshop",
"href": "%dropbox_output%"
}
]
}
