Local and cloud-based workflows for extracting and updating text layers in PSD files via ExtendScript and Adobe PS API. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
194 lines
No EOL
7.5 KiB
Markdown
194 lines
No EOL
7.5 KiB
Markdown
# Adobe Photoshop API Status Update
|
|
|
|
## Latest Information from Adobe (April 22, 2025)
|
|
|
|
Adobe has provided the following clarifications regarding API access and endpoints:
|
|
|
|
### Authentication
|
|
|
|
To generate an access token:
|
|
|
|
1. Send a POST request to `https://ims-na1.adobelogin.com/ims/token/v3` with these parameters:
|
|
- `client_id`: The client_id value provided by Adobe
|
|
- `client_secret`: The client_secret value provided by Adobe
|
|
- `grant_type`: Set to `client_credentials`
|
|
- `scope`: Varies by service
|
|
- For Photoshop API: `openid,AdobeID,read_organizations`
|
|
- For Firefly API: `openid,AdobeID,firefly_api,ff_apis`
|
|
|
|
2. Response includes:
|
|
- `access_token`: Token for API requests
|
|
- `token_type`: Will be "bearer"
|
|
- `expires_in`: ~86399 (24 hours)
|
|
|
|
**Note**: Tokens expire after 24 hours; a new token must be generated after expiration.
|
|
|
|
### API Endpoints
|
|
|
|
#### Corrected Information
|
|
|
|
- **Photoshop REST API**:
|
|
- Uses the subdomain `image.adobe.io` exclusively
|
|
- Action JSON endpoint: `https://image.adobe.io/pie/psdService/actionJSON`
|
|
- Product Crop endpoint: `https://image.adobe.io/pie/psdService/productCrop`
|
|
|
|
- **Not Used for Photoshop REST API**:
|
|
- `photoshop.adobe.io`
|
|
- `photoshop-services.adobe.io`
|
|
|
|
#### File Storage
|
|
|
|
- Adobe does NOT provide endpoints to generate pre-signed URLs
|
|
- Instead, use external storage solutions like Amazon S3, Azure Storage, or Google Cloud Storage
|
|
- These services support creating pre-signed URLs for use with Adobe APIs
|
|
|
|
## Implementation Changes Required
|
|
|
|
Based on Adobe's clarification, we need to make these changes:
|
|
|
|
1. **Update API Endpoints**:
|
|
- Replace `https://firefly-api.adobe.io/v2/photoshop/editText` with `https://image.adobe.io/pie/psdService/actionJSON`
|
|
- Remove attempts to use the presigned URL endpoints at Adobe
|
|
|
|
2. **Storage Approach**:
|
|
- Continue using Google Cloud Storage for file storage
|
|
- Generate signed URLs for both input and output files using GCS
|
|
- Use these URLs in API requests to Adobe
|
|
|
|
3. **Authentication**:
|
|
- Use the correct scope for each API:
|
|
- Photoshop API: `openid,AdobeID,read_organizations`
|
|
- Firefly API: `openid,AdobeID,firefly_api,ff_apis`
|
|
|
|
These changes have been implemented in the latest code updates.
|
|
|
|
## Current Status
|
|
|
|
- ✅ Fixed token generation with correct scopes
|
|
- ✅ Updated to use the correct API endpoints
|
|
- ✅ Configured external storage (GCS) for file handling and signed URLs
|
|
- ✅ Successfully implemented asyncronous processing with the Adobe API
|
|
- ✅ Full workflow technically working from upload to downloading processed files
|
|
- ❌ Text layer updates not applied by the API despite successful responses (202)
|
|
|
|
## Key Findings from Testing
|
|
|
|
1. **Authentication**: Using the correct client secret, we were able to successfully authenticate with Adobe's API
|
|
2. **API Endpoints**: The `/text` endpoint is the correct one to use, not `actionJSON`
|
|
3. **Layer IDs**: The API requires integer IDs for layers, strings are not accepted
|
|
4. **Async Processing**: The API returns a 202 Accepted status, processes asynchronously, and then puts the result in the output URL
|
|
5. **External Storage**: Using Google Cloud Storage with signed URLs works correctly
|
|
6. **Layer Update Issue**: Despite all other aspects working correctly, **the API does not actually update the text layers in the output file** regardless of what layer identification method is used
|
|
|
|
## Comprehensive Text Layer Update Issue Investigation
|
|
|
|
After extensive testing with the Adobe Photoshop API, we've determined:
|
|
|
|
1. **API Response Pattern**:
|
|
- The API consistently returns 202 Accepted for text update requests
|
|
- Status URL shows "succeeded" processing
|
|
- Output files are generated successfully
|
|
- **BUT** the text layers in the output files remain unchanged
|
|
|
|
2. **Attempted Solutions**:
|
|
- Tried various layer identification methods (ID, name, path)
|
|
- Tested different numeric ID values
|
|
- Used combinations of identifiers
|
|
- Verified all aspects of the API call (auth, URLs, format)
|
|
- All attempts received successful API responses but no actual text changes
|
|
|
|
A detailed report of our testing and potential solutions has been documented in `API-LAYER-ID-SOLUTION.md`, recommending the use of our local scripting approach instead of the API until this issue can be resolved.
|
|
|
|
## Recommended Next Steps
|
|
|
|
1. **Continue Using Local Script Workflow**:
|
|
- Use the working `mac_ps_extract.py` and `mac_ps_update.py` scripts
|
|
- These directly interact with Photoshop through ExtendScript
|
|
- Reliably update text layers with proper formatting
|
|
|
|
2. **Contact Adobe Developer Support**:
|
|
- Request clarification on text layer updates via API
|
|
- Share our test results showing the issue
|
|
- Ask for sample code or documentation
|
|
|
|
3. **Documentation and Training**:
|
|
- Document the existing local workflow thoroughly
|
|
- Train team members on the ExtendScript-based approach
|
|
- Maintain API code for future updates from Adobe
|
|
|
|
## Future API Development (When Fixed)
|
|
|
|
If Adobe resolves the API issues in the future:
|
|
|
|
1. Update our layer ID extraction script
|
|
2. Modify JSON generation to include proper IDs
|
|
3. Update API integration accordingly
|
|
4. Implement hybrid approach for flexibility
|
|
|
|
## Reference Documentation
|
|
|
|
- [Adobe Firefly Services Documentation](https://developer.adobe.com/firefly-services/docs/photoshop/general-workflow/#input-and-output-file-storage)
|
|
- [Adobe Photoshop API Documentation](https://developer.adobe.com/firefly-services/docs/photoshop/quickstart/#retrieve-an-access-token)
|
|
|
|
---
|
|
|
|
## Previous Status (April 17, 2025)
|
|
|
|
### Authentication: ✅ WORKING
|
|
|
|
- The new access token (created April 17, 2025) successfully authenticates
|
|
- Adobe IMS user info endpoint returns 200 OK response
|
|
- Authentication to IMS services is now fully functional
|
|
|
|
### Service Endpoints and Storage: ✅ CONFIGURED
|
|
|
|
We have fully implemented the correct Adobe API workflow with external storage:
|
|
|
|
1. Text Editing API: ✅ FORMAT CONFIRMED & INTEGRATED
|
|
- `https://image.adobe.io/pie/psdService/text`: API endpoint now correctly configured
|
|
- Proper payload format implemented using:
|
|
- Layer ID as integer
|
|
- Text as an object with content field
|
|
- Input/output references as valid signed URLs from Google Cloud Storage
|
|
- Storage type set to "external" (as per documentation)
|
|
|
|
2. Storage Integration: ✅ GCS IMPLEMENTED
|
|
- Complete Google Cloud Storage integration added
|
|
- Using bucket `lor-txt-tmp-bkt` for temporary file storage
|
|
- Functionality includes:
|
|
- File upload to GCS
|
|
- Signed URL generation for both read and write operations
|
|
- Output file retrieval and download
|
|
- Full workflow automation
|
|
|
|
3. DNS Resolution Issues:
|
|
- Some Adobe domains still can't be resolved:
|
|
- `photoshop.adobe.io`
|
|
- `cc-api.adobe.io`
|
|
|
|
## Token Analysis
|
|
|
|
The JWT token has been decoded and analyzed, revealing:
|
|
|
|
```json
|
|
{
|
|
"id": "1744876343937_515b5458-d574-47de-8f78-b490c0b6b9f2_ue1",
|
|
"org": "FAD61E276686DB3D0A495EC4@AdobeOrg",
|
|
"type": "access_token",
|
|
"client_id": "f34becb759244899bd73b86220f6fb92",
|
|
"user_id": "DA371F5767EBD07D0A495F94@techacct.adobe.com",
|
|
"as": "ims-na1",
|
|
"aa_id": "DA371F5767EBD07D0A495F94@techacct.adobe.com",
|
|
"ctp": 3,
|
|
"moi": "30055fe7",
|
|
"expires_in": "86400000",
|
|
"created_at": "1744876343937",
|
|
"scope": "openid,AdobeID,read_organizations"
|
|
}
|
|
```
|
|
|
|
Key findings:
|
|
- Token created: April 17, 2025
|
|
- Expiration: Set for 1000 days from creation (January 12, 2028)
|
|
- Scopes: `openid,AdobeID,read_organizations`
|
|
- Technical account: `DA371F5767EBD07D0A495F94@techacct.adobe.com` |