- Sign up to create a credential in order to use Photoshop API. When creating a credential, a zip file (config.zip) will be automatically downloaded. It contains your private key (private.key). Please store the private key securely, since Adobe does not retain a copy of it.
AWS
- Create AWS accont
- Set up AWS CLI
- Install AWS CLI
- Configure AWS CLI options:
aws configure
- Test AWS CLI:
aws s3 ls
to list S3 objects
- Clone this project:
git clone https://github.com/kmikawa/adobe-ps-api-sdk-sample.git
- Install node modules:
npm install
- Unzip your downloaded config.zip and save
private.key
asconfig/private.key
in this project - Save
config/config-template.js
asconfig/config.js
- Fill the following configuration in
config/config.js
, save, and close.
// Adobe Photoshop API Configuration
// https://developer.adobe.com/console/projects -> project -> Service Account (JWT)
const adobeConfig = {
clientId: "",
clientSecret: "",
technicalAccountId: "",
orgId: "",
metaScopes: ["ent_ccas_sdk"],
};
// AWS Configuration
// https://aws.amazon.com/console/
const awsConfig = {
region: "", // us-east-1
bucketName: "" // aws s3 bucket name
}
- Run a sample
node src/sample/psapi/01_createCutout.js
- Find your output file in your S3 storage, output directory (ex: s3://<awsConfig.bucketName>/output/...)
- Store multiple JPEG files in your S3 storage (ex: s3://<awsConfig.bucketName>/input/...) or modify input/output directories in the sample script.
// -------------------------------------------------
// Enter your parameters
// -------------------------------------------------
const inputDir = 'input/' //your input directory in S3 bucket (ex: s3://<awsConfig.bucketName>/input)
const outputDir = 'output' //your output directory in S3 bucket (ex: s3://<awsConfig.bucketName>/input/output)
const listObjectsInputRequest = { //URI Request Parameters
// Add more request as you like. see https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html for more details
Bucket: awsConfig.bucketName, //Bucket name to list.
Prefix: inputDir, // Keys that begin with the indicated prefix.
MaxKeys: 5 // Sets the maximum number of keys returned in the response. By default the action returns up to 1,000 key names.
};
// -------------------------------------------------
- Run a sample
node src/sample/batch_job/01_createCutout_batch.js
- Find your output files in your S3 storage, output directory (ex: s3://<awsConfig.bucketName>/input/output/...)
- You can also use AWS CLI to sync files from your S3 storage into your local machine (ex:
aws s3 sync s3://<awsConfig.bucketName>/input/output/ /Users/<username>/Desktop/output/
)