### Example input request body Source: https://github.com/adobedocs/ffs-illustrator-api/blob/main/src/pages/guides/custom-scripts/index.md Sample input request body with assets array containing source URLs and destinations, and params including targetDocument, outputFolderPath, zip, assetDataFolderPath, and someParam. ```json { "assets": [ { "source": { "url": "" }, "destination": "template.ai" }, { "source": { "url": "" }, "destination": "assets.zip" } ], "params": { "targetDocument": "template.ai", "outputFolderPath": "results", "zip": "assets.zip", "assetDataFolderPath" : "assets", "someParam": "sampleValue" } } ``` -------------------------------- ### Custom Script manifest JSON example Source: https://github.com/adobedocs/ffs-illustrator-api/blob/main/src/pages/getting-started/concepts/index.md Example manifest.json file for a custom script, showing required fields like manifestVersion, name, version, host.app, and apiEntryPoints. The host.app must be 'illustrator' and appVersionStrategy can be one of three values. ```json { "manifestVersion": "1.0.0", "id": "", "name": "", "version": "", "host": { "app": "illustrator", "appVersionStrategy": "latest_version" | "fixed_major_version" | "fixed_major_and_minor_version", "majorAppVersion": 20, // optional depending on strategy "minorAppVersion": 1 // optional depending on strategy }, "apiEntryPoints": [ { "type": "capability", "path": "script.jsx", "language": "extendscript" } ] } ``` -------------------------------- ### Example request body for Image Trace Source: https://github.com/adobedocs/ffs-illustrator-api/blob/main/src/pages/guides/image-trace/index.md JSON request body for submitting an Image Trace job. Requires input.source.url (presigned URL) and input.mediaType (image/png or image/jpeg). Optional settings.preset can be 'enhanced_general' or 'high_fidelity_photo'; omitting uses the service default. ```json { "input": { "source": { "url": "https://example.blob.core.windows.net/container/art.png?sas..." }, "mediaType": "image/png" }, "settings": { "preset": "enhanced_general" } } ``` -------------------------------- ### Fetch params passed in script Source: https://github.com/adobedocs/ffs-illustrator-api/blob/main/src/pages/guides/custom-scripts/index.md All parameters passed in "params" can be fetched using "paramsMap". in the script. This example shows how to extract targetDocument and outputFolderPath values. ```javascript var arg1 = paramsMap.targetDocument; var arg2 = paramsMap.outputFolderPath; // Some processing ``` -------------------------------- ### Status response (failed) Source: https://github.com/adobedocs/ffs-illustrator-api/blob/main/src/pages/guides/image-trace/index.md Response from GET /v1/status/{jobId} when the job fails. Contains error_code and message fields. ```json { "jobId": "fe0f4a1a-a213-44bd-b37b-8aa2f636449c", "status": "failed", "error_code": "", "message": "" } ``` -------------------------------- ### POST /v1/trace-image Source: https://github.com/adobedocs/ffs-illustrator-api/blob/main/src/pages/guides/image-trace/index.md Submits an Image Trace job for raster-to-vector conversion. Accepts PNG/JPEG input and returns a job ID and status URL for polling. ```APIDOC ## [POST] /v1/trace-image ### Description Submits an Image Trace job for raster-to-vector conversion. Accepts PNG/JPEG input and returns a job ID and status URL for polling. ### Method POST ### Endpoint https://illustrator-api.adobe.io/v1/trace-image ### Parameters #### Request Body - **input** (object) - Required - Input file details. - **input.source.url** (string) - Required - Pre-signed URL of the input file. - **input.mediaType** (string) - Required - Media type of the input file. Allowed values: `image/png`, `image/jpeg`. - **settings** (object) - Optional - Optional object containing only `preset`. - **settings.preset** (string) - Optional - One of: **`enhanced_general`** — vector-looking generated output; **`high_fidelity_photo`** — photorealistic tracing. Omit to use the service default. Any other value returns 400. ### Response #### Success Response (202 Accepted) - **jobId** (string) - The job identifier. - **statusUrl** (string) - URL to poll for job status. ### Request Example ```json { "input": { "source": { "url": "https://example.blob.core.windows.net/container/art.png?sas..." }, "mediaType": "image/png" }, "settings": { "preset": "enhanced_general" } } ``` #### Response Example ```json { "jobId": "f7da0875-7919-486d-b915-7258c89f09e0", "statusUrl": "https://illustrator-api.adobe.io/v1/status/f7da0875-7919-486d-b915-7258c89f09e0" } ``` ``` -------------------------------- ### Status response (succeeded) Source: https://github.com/adobedocs/ffs-illustrator-api/blob/main/src/pages/guides/image-trace/index.md Response from GET /v1/status/{jobId} when the job succeeds. Contains presigned URLs in outputs for downloading SVG files. ```json { "jobId": "f7da0875-7919-486d-b915-7258c89f09e0", "status": "succeeded", "outputs": [ { "destination": { "url": "" }, "mediaType": "image/svg+xml" } ] } ``` -------------------------------- ### Submit response (202 Accepted) Source: https://github.com/adobedocs/ffs-illustrator-api/blob/main/src/pages/guides/image-trace/index.md Response from POST /v1/trace-image when the job is accepted. Contains jobId and statusUrl for polling. ```json { "jobId": "f7da0875-7919-486d-b915-7258c89f09e0", "statusUrl": "https://illustrator-api.adobe.io/v1/status/f7da0875-7919-486d-b915-7258c89f09e0" } ``` -------------------------------- ### GET /v1/status/{jobId} Source: https://github.com/adobedocs/ffs-illustrator-api/blob/main/src/pages/guides/image-trace/index.md Polls the status of an Image Trace job. Returns job status and, upon success, presigned URLs for SVG output. ```APIDOC ## [GET] /v1/status/{jobId} ### Description Polls the status of an Image Trace job. Returns job status and, upon success, presigned URLs for SVG output. ### Method GET ### Endpoint https://illustrator-api.adobe.io/v1/status/{jobId} ### Parameters #### Path Parameters - **jobId** (string) - Required - The job identifier returned from the submit response. ### Response #### Success Response (succeeded) - **jobId** (string) - The job identifier. - **status** (string) - The job status, e.g., `succeeded`. - **outputs** (array) - Array of output objects. - **outputs[].destination.url** (string) - Presigned URL for downloading the SVG output. - **outputs[].mediaType** (string) - Media type of the output, e.g., `image/svg+xml`. #### Error Response (failed) - **jobId** (string) - The job identifier. - **status** (string) - The job status, e.g., `failed`. - **error_code** (string) - Error code. - **message** (string) - Error message. #### Response Example (succeeded) ```json { "jobId": "f7da0875-7919-486d-b915-7258c89f09e0", "status": "succeeded", "outputs": [ { "destination": { "url": "" }, "mediaType": "image/svg+xml" } ] } ``` #### Response Example (failed) ```json { "jobId": "fe0f4a1a-a213-44bd-b37b-8aa2f636449c", "status": "failed", "error_code": "", "message": "" } ``` ``` -------------------------------- ### Specify input assets with pre-signed URLs Source: https://github.com/adobedocs/ffs-illustrator-api/blob/main/src/pages/getting-started/concepts/index.md Shows how to define input assets in the assets array, each with a source URL and a destination filename. The source attribute is where the asset is downloaded from, and the destination attribute is where the asset will be downloaded to. ```json "assets" :[ { "source" : { "url" : "https://xyz-blob.core.windows.net/Template.ai" }, "destination" : "template1.ai" }, { "source" : { "url" : "https://s3.eu-west-1.amazonaws/xyz/assets.zip" }, "destination" : "assets.zip" } ] ``` -------------------------------- ### Sample code that takes the input Source: https://github.com/adobedocs/ffs-illustrator-api/blob/main/src/pages/guides/custom-scripts/index.md Sample JavaScript code that opens a document using paramsMap.targetDocument, accesses assetDataFolderPath, and exports the document. The document should be closed without saving changes using doc.close(SaveOptions.DONOTSAVECHANGES). ```javascript var inputFile = new File(paramsMap.targetDocument); var jpegDataPath = paramsMap.assetDataFolderPath + "/jpegData/"; var extraParam = paramsMap.someParam; if (!inputFile.exists) { throw new Error('Input file not found: ' + inputFile.fsName); } var doc = app.open(inputFile); var outputFilePath = paramsMap.outputFolderPath + "/result_output.ai"; someProcessing(extraParam, jpegDataPath); var outputFile = new File(outputFilePath); doc.exportAsFormat(ExportFileType.ET_AI, outputFile); doc.close(SaveOptions.DONOTSAVECHANGES); ``` -------------------------------- ### Custom script bundle structure Source: https://github.com/adobedocs/ffs-illustrator-api/blob/main/src/pages/getting-started/concepts/index.md Shows the required file structure for a custom script bundle: a folder containing manifest.json and script.jsx. ```text custom-script-folder |------ manifest.json |------ script.jsx ``` -------------------------------- ### Export access token as environment variable Source: https://github.com/adobedocs/ffs-illustrator-api/blob/main/src/pages/getting-started/index.md After generating the access token, export it as an environment variable for use in subsequent API calls. Replace with the actual token value. ```bash export ILLUSTRATOR_API_ACCESS_TOKEN= ``` -------------------------------- ### Generate access token with curl Source: https://github.com/adobedocs/ffs-illustrator-api/blob/main/src/pages/getting-started/index.md Use this curl command to request an access token from the IMS endpoint. It requires the client ID and secret as environment variables and returns a JSON response containing the access token, token type, and expiration time. ```bash curl --location 'https://ims-na1.adobelogin.com/ims/token/v3' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'grant_type=client_credentials' \ --data-urlencode "client_id=ILLUSTRATOR_API_CLIENT_ID" \ --data-urlencode "client_secret=ILLUSTRATOR_API_CLIENT_SECRET" \ --data-urlencode 'scope=openid, AdobeID, ff_apis, firefly_enterprise, illustrator_services_beta' ``` -------------------------------- ### Structure after unzipping assets.zip Source: https://github.com/adobedocs/ffs-illustrator-api/blob/main/src/pages/guides/custom-scripts/index.md Shows the folder structure after unzipping assets.zip, with pngData and jpegData subfolders under the assets folder. ```text C:\basefolder\assets ├── pngData/ └── jpegData/ ``` -------------------------------- ### Export Client ID and Client Secret as environment variables Source: https://github.com/adobedocs/ffs-illustrator-api/blob/main/src/pages/getting-started/index.md Set the ILLUSTRATOR_API_CLIENT_ID and ILLUSTRATOR_API_CLIENT_SECRET environment variables in a secure terminal. Replace the placeholders with your actual credentials from the Adobe Developer Console project. ```bash export ILLUSTRATOR_API_CLIENT_ID= export ILLUSTRATOR_API_CLIENT_SECRET= ``` -------------------------------- ### Required input JSON structure for custom script Source: https://github.com/adobedocs/ffs-illustrator-api/blob/main/src/pages/guides/custom-scripts/index.md The system sends a string-type argument named "params" that must be parsed inside the script. The params object includes required fields targetDocument and outputFolderPath, and optional zip and fontFolderPath. The assets array contains paths to input files. ```json { "assets": [ {"path": "template.ai"}, {"path": "assets.zip"}, ... ], "params": { "targetDocument": "template.ai", "outputFolderPath": "results", "zip": "assets.zip", "assetDataFolderPath" : "assets/pngData" ... } } ``` -------------------------------- ### Transformed input request sent to the script Source: https://github.com/adobedocs/ffs-illustrator-api/blob/main/src/pages/guides/custom-scripts/index.md Any parameter ending with "FolderPath" is processed and converted to an absolute path, as shown with assetDataFolderPath. The assets array is simplified to paths. ```json { "assets": [ { "path": "template.ai" } ], "params": { "targetDocument": "C:\basefolder\template.ai", "outputFolderPath": "C:\basefolder\results", "assetDataFolderPath" : "C:\basefolder\assets", "someParam": "sampleValue" } } ``` -------------------------------- ### Access token response Source: https://github.com/adobedocs/ffs-illustrator-api/blob/main/src/pages/getting-started/index.md The response from the token endpoint includes the access token, token type, and expiration time in seconds. The expires_in field indicates how long the token is valid before a new one is required. ```json { "access_token": "exampleAccessTokenAsdf123", "token_type": "bearer", "expires_in": 86399 } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.