### GET /templates Source: https://developers.switchboard.ai/property/text/opacity Retrieves a list of all available templates. ```APIDOC ## GET /templates ### Description Retrieves a list of all available templates. ### Method GET ### Endpoint /templates ### Response #### Success Response (200) - **templates** (array) - A list of available templates. - **name** (string) - The name of the template. - **apiName** (string) - The API name of the template. #### Response Example ```json { "templates": [ { "name": "Welcome Email", "apiName": "welcome-email" }, { "name": "Product Announcement", "apiName": "product-announcement" } ] } ``` ``` -------------------------------- ### Video Processing Request Example Source: https://developers.switchboard.ai/docs/video An example of a JSON request body to overlay an image onto a video. It includes the template name, desired sizes, the URL of the video, and a webhook URL for completion notifications. ```json { "template": "video-test", "sizes": [ { "width": 1920, "height": 1080 } ], "videos": [ { "url": "https://example.com/video.mp4" } ], "webhook": "https://example.com/webhook" } ``` -------------------------------- ### GET /templates Source: https://developers.switchboard.ai/property/text Fetches a list of all available templates. ```APIDOC ## GET /templates ### Description Retrieves a comprehensive list of all templates available within the system. ### Method GET ### Endpoint /templates ### Parameters (No parameters for this endpoint) ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **templates** (array) - A list of available templates. Each item typically includes the template name and its API identifier. #### Response Example ```json { "templates": [ { "name": "Welcome Banner", "apiName": "welcome-banner-template" }, { "name": "Product Card", "apiName": "product-card-template" } ] } ``` ``` -------------------------------- ### GET Templates Source: https://developers.switchboard.ai/property/image/opacity Retrieves a list of available templates. ```APIDOC ## GET /templates ### Description Retrieves a list of available templates. ### Method GET ### Endpoint /templates ### Parameters No specific parameters are listed for this endpoint in the provided text. ### Request Example N/A for GET requests without query parameters or body. ### Response #### Success Response (200) - The response structure for this endpoint is not specified in the provided text, but it would likely contain a list of templates. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### GET /templates Source: https://developers.switchboard.ai/property/image/backgroundcolor Retrieves a list of available templates. ```APIDOC ## GET /templates ### Description Retrieves a list of available templates. ### Method GET ### Endpoint /templates ### Parameters #### Query Parameters (No specific query parameters mentioned in the provided text) ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **(Type)** - Description of the response body containing a list of templates. (Details not provided in the text) #### Response Example ```json { "example": "response body for GET /templates" } ``` ``` -------------------------------- ### GET /templates 200 Response Example Source: https://developers.switchboard.ai/docs/get-templates This is an example of a successful response (200 OK) when requesting the list of templates from the Switchboard API. It returns a success status and an array of template objects, each with an apiName and displayName. ```json { "success": true, "template": [ { "apiName": "my-template", "displayName": "My Template" } ] } ``` -------------------------------- ### Video Processing Webhook Response Example Source: https://developers.switchboard.ai/docs/video An example of the JSON payload received by the webhook URL upon completion of video processing. It details the batch status, processing duration, and the URL of the generated video file. ```json { "batchId": "7bb38cf7-94ff-4363-9600-cdfe3c00a3a0", "success": true, "message": "All records processed", "summary": [ { "api_call_id": "570cae86-d758-45cb-8979-798547bff8a5", "duration": 36484, "status": "successful", "result": { "url": "https://files.canvas.switchboard.ai/570a...f8a5/6704...4422.mp4", "success": true } } ] } ``` -------------------------------- ### GET /templates Source: https://developers.switchboard.ai/property/request/template Retrieves a list of all available templates. ```APIDOC ## GET /templates ### Description Fetches a list of all available templates in the system. ### Method GET ### Endpoint /templates ### Parameters ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **templates** (array) - A list of available templates. - **api_name** (string) - The unique API name of the template. - **name** (string) - The human-readable name of the template. #### Response Example ```json { "templates": [ { "api_name": "welcome_email", "name": "Welcome Email Template" }, { "api_name": "invoice_receipt", "name": "Invoice Receipt" } ] } ``` ``` -------------------------------- ### GET /templates Source: https://developers.switchboard.ai/property/verticalalignment Retrieves a list of all available templates. ```APIDOC ## GET /templates ### Description Retrieves a list of all available templates within the system. ### Method GET ### Endpoint /templates ### Parameters None ### Request Example ```json { "example": "GET /templates" } ``` ### Response #### Success Response (200) * **templates** (array) - A list of available templates, where each item typically includes a name and an identifier. * **name** (string) - The display name of the template. * **apiName** (string) - The unique API name of the template. #### Response Example ```json { "templates": [ { "name": "Invoice Template", "apiName": "invoice-template-v1" }, { "name": "Social Media Post", "apiName": "social-post-template" } ] } ``` ``` -------------------------------- ### GET /templates Source: https://developers.switchboard.ai/property/request/webhook Retrieves a list of all available templates. ```APIDOC ## GET /templates ### Description Retrieves a list of all available templates within the system. ### Method GET ### Endpoint /templates ### Response #### Success Response (200) * **templates** (array) - An array of template objects, each containing template details. #### Response Example ```json { "templates": [ { "name": "Default Template", "api_name": "default-template", "created_at": "2023-01-01T10:00:00Z" }, { "name": "Marketing Card", "api_name": "marketing-card", "created_at": "2023-01-02T11:00:00Z" } ] } ``` ``` -------------------------------- ### GET /templates Source: https://developers.switchboard.ai/property/image/qrcode Retrieves a list of all available templates. ```APIDOC ## GET /templates ### Description Fetches a list of all templates available within the system. ### Method GET ### Endpoint /templates ### Parameters * None specified ### Request Example (No request body for GET requests) ### Response #### Success Response (200) * **templates** (array) - An array of template objects, each containing details about a template. #### Response Example ```json { "templates": [ { "name": "Invoice Template", "apiName": "invoice-template-v1" }, { "name": "QR Code Template", "apiName": "my-qr-code" } ] } ``` ``` -------------------------------- ### GET /templates Source: https://developers.switchboard.ai/property/rectangle/fillcolor Retrieves a list of all available templates. ```APIDOC ## GET /templates ### Description Retrieves a list of all available templates. ### Method GET ### Endpoint /templates ### Response #### Success Response (200) - **templates** (array) - A list of available templates. - **name** (string) - The name of the template. - **apiName** (string) - The API name of the template. - **description** (string) - A brief description of the template. #### Response Example ```json { "templates": [ { "name": "Invoice Template", "apiName": "invoice-v1", "description": "A template for generating invoices." }, { "name": "Marketing Banner", "apiName": "banner-promo", "description": "Template for promotional marketing banners." } ] } ``` ``` -------------------------------- ### GET Templates Source: https://developers.switchboard.ai/property/request/url Retrieves a list of available templates. ```APIDOC ## GET /templates ### Description Retrieves a list of all available templates within the system. ### Method GET ### Endpoint /templates ### Parameters No specific parameters are documented for this endpoint. ### Request Example No request body is expected for this GET request. ### Response #### Success Response (200) - **templates** (array) - A list of templates. - **api_name** (string) - The unique API name of the template. - **name** (string) - The human-readable name of the template. #### Response Example ```json { "templates": [ { "api_name": "newsletter_v1", "name": "Newsletter Template v1" }, { "api_name": "invoice_basic", "name": "Basic Invoice" } ] } ``` ``` -------------------------------- ### GET /templates Source: https://developers.switchboard.ai/property/request/batchurl Retrieves a list of available templates. ```APIDOC ## GET /templates ### Description Retrieves a list of all available templates. ### Method GET ### Endpoint /templates ### Parameters No parameters are specified for this endpoint. ### Request Example No request example is provided. ### Response #### Success Response (200) - **templates** (array) - A list of available templates. ``` -------------------------------- ### GET /templates Source: https://developers.switchboard.ai/index Retrieves a list of available templates. ```APIDOC ## GET /templates ### Description Retrieves a list of available templates. ### Method GET ### Endpoint /templates ### Response #### Success Response (200) - **templates** (array) - A list of template names. #### Response Example ```json { "templates": [ "twitter_tweet", "product_card", "banner_ad" ] } ``` ``` -------------------------------- ### GET /templates Source: https://developers.switchboard.ai/docs/video Retrieves a list of available templates. ```APIDOC ## GET /templates ### Description Retrieves a list of all available templates. ### Method GET ### Endpoint /templates ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **templates** (array of strings) - A list of template names. #### Response Example ```json { "templates": [ "welcome_template", "product_announcement", "video_overlay_basic" ] } ``` ``` -------------------------------- ### Get Templates Source: https://developers.switchboard.ai/property/text/angle Retrieves a list of available templates. ```APIDOC ## GET /templates ### Description Retrieves a list of all available templates. ### Method GET ### Endpoint /templates ### Response #### Success Response (200) - **templates** (array) - An array of template objects. #### Response Example ```json { "templates": [ { "name": "Welcome Email", "id": "tpl_abc123" }, { "name": "Product Announcement", "id": "tpl_def456" } ] } ``` ``` -------------------------------- ### GET /templates Source: https://developers.switchboard.ai/property/image/horizontalalignment Retrieves a list of all available templates. ```APIDOC ## GET /templates ### Description Retrieves a list of all available templates within the system. ### Method GET ### Endpoint /templates ### Parameters None ### Response #### Success Response (200) - **templates** (array) - An array of objects, where each object represents a template. - **name** (string) - The display name of the template. - **apiName** (string) - The unique API name of the template. #### Response Example ```json { "templates": [ { "name": "Welcome Card", "apiName": "welcome_card_v1" }, { "name": "Product Announcement", "apiName": "product_promo_v2" } ] } ``` ``` -------------------------------- ### GET Templates Source: https://developers.switchboard.ai/property/maximumfontsize Retrieves a list of available templates. ```APIDOC ## GET /templates ### Description Retrieves a list of available templates. ### Method GET ### Endpoint /templates ### Parameters ### Request Body (This endpoint does not have a request body.) ### Request Example (No example provided in the input text.) ### Response #### Success Response (200) - (No specific fields detailed in the input text.) #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### GET /templates Source: https://developers.switchboard.ai/property/text/fontFamily Retrieves a list of available templates. ```APIDOC ## GET /templates ### Description Retrieves a list of all available templates that can be used for content generation. ### Method GET ### Endpoint /templates ### Response #### Success Response (200) - **templates** (array) - A list of available templates. - **name** (string) - The name of the template. - **description** (string) - A brief description of the template. - **apiName** (string) - The unique API name for the template. #### Response Example ```json { "templates": [ { "name": "Standard Post", "description": "A template for standard social media posts.", "apiName": "standard-post" }, { "name": "Event Announcement", "description": "Template for announcing events.", "apiName": "event-announcement" } ] } ``` ``` -------------------------------- ### POST / Request Format - Basic Example Source: https://developers.switchboard.ai/docs/api This is the most basic valid request for creating an image. It requires a `template` name and a `sizes` array containing at least one object with `width` and `height` properties. ```json { "template": "template-api-name", "sizes": [ { "width": 1080, "height": 1080 } ] } ``` -------------------------------- ### Image Generation via GET Request Source: https://developers.switchboard.ai/docs/get-support Documentation for generating and caching images using GET requests, including configuration and request formatting. ```APIDOC ## HTTP GET Support ### Description Switchboard Canvas supports creating and caching images based on a GET request. This allows dynamic image creation by passing all required information in the query string of the URL. After initial generation, images are cached for 7 days. ### Method GET ### Endpoint `https://images.canvas.switchboard.ai` ### Parameters #### Query Parameters * **apiKey** (string) - Required - Your unique GET API key. * **template** (string) - Required - The name of the template to use. * **width** (integer) - Required - The desired width of the generated image. * **height** (integer) - Required - The desired height of the generated image. * **[elementName].[propertyName]** (string) - Optional - Targets specific properties of template elements (e.g., `headline.text`, `headline.textColor`). ### Request Example ``` https://images.canvas.switchboard.ai? apiKey= &template= &width=1920 &height=1000 &headline.text=This is the headline &headline.textColor=FF0000 ``` ### Response #### Success Response (200) * **url** (string) - The URL to the generated and cached image. * **status** (string) - Indicates if the image was generated successfully. #### Response Example ```json { "status": "success", "url": "https://images.canvas.switchboard.ai/cached-image-url" } ``` ### Configuration * **GET API Key**: A separate API key is required for GET requests, found under 'View API Keys' on the main template page. * **Allowed Hosts**: IP addresses of hosts allowed to make GET requests must be added to the 'Allowed Hosts' list in the Integrations page to prevent unauthorized usage. ``` -------------------------------- ### Format HTTP GET Request for Switchboard Canvas Source: https://developers.switchboard.ai/docs/get-support Demonstrates the structure of an HTTP GET request to Switchboard Canvas, including API key, template name, dimensions, and targeting specific template properties. ```http https://images.canvas.switchboard.ai? apiKey= &template= &width=1920 &height=1000 &headline.text=This is the headline &headline.textColor=FF0000 ``` -------------------------------- ### POST / Source: https://developers.switchboard.ai/property/image/backgroundcolor This endpoint is likely for initiating a process or creating a new resource at the root level. Specific functionality depends on the service's implementation. ```APIDOC ## POST / ### Description This endpoint is likely for initiating a process or creating a new resource at the root level. Specific functionality depends on the service's implementation. ### Method POST ### Endpoint / ### Parameters #### Query Parameters (No specific query parameters mentioned in the provided text) #### Request Body (The request body schema is not detailed in the provided text. It might include parameters related to initiating a process or creating a resource.) ### Request Example ```json { "example": "request body for POST /" } ``` ### Response #### Success Response (200) - **(Type)** - Description of the success response. (Details not provided in the text) #### Response Example ```json { "example": "response body for POST /" } ``` ``` -------------------------------- ### POST Root / Source: https://developers.switchboard.ai/property/text This endpoint is used to initiate a process at the root level, likely for creating or processing a default item. ```APIDOC ## POST / ### Description Initiates a process at the root level. This is typically used for creating or processing a default item or request. ### Method POST ### Endpoint / ### Parameters #### Query Parameters - **request** (object) - Optional - Contains various properties for the request, such as format, quality, template details, sizes, URLs, webhook, and API keys. - **text** (object) - Optional - Specifies text-related properties like angle, fill, font, opacity, alignment, font size, and color. - **image** (object) - Optional - Defines image-related properties including angle, background color, opacity, corner radius, alignment, and background removal options. - **rectangle** (object) - Optional - Contains properties for rectangle elements like angle, fill color, and opacity. ### Request Example ```json { "request": { "format": "png", "quality": 90, "template": "my-template", "sizes": ["large", "medium"], "url": "http://example.com/image.jpg", "webhook": "http://example.com/webhook", "airtableApiKey": "your_airtable_api_key", "tweet": "Check out this amazing image! #AI" }, "text": { "angle": 0, "fillTextBox": true, "fontFamily": "Arial", "opacity": 1, "horizontalAlignment": "center", "maximumFontSize": 24, "text": "Hello, World!", "textColor": "#000000" }, "image": { "angle": 0, "backgroundColor": "#FFFFFF", "backgroundOpacity": 1, "contain": true, "cornerRadius": 10, "horizontalAlignment": "center", "opacity": 1, "removeBackground": false, "url": "http://example.com/source.png", "qrCode": "http://example.com/qr" }, "rectangle": { "angle": 0, "fillColor": "#FF0000", "opacity": 0.5 } } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success status of the operation. - **message** (string) - A confirmation message about the processed request. #### Response Example ```json { "status": "success", "message": "Root process completed successfully." } ``` ``` -------------------------------- ### POST Root Source: https://developers.switchboard.ai/index Creates a new template or resource at the root endpoint. ```APIDOC ## POST / ### Description Creates a new template or resource at the root endpoint. ### Method POST ### Endpoint / ### Parameters #### Request Body - **format** (string) - Optional - The desired output format for the generated image. - **quality** (integer) - Optional - The quality setting for the generated image. - **template** (string) - Required - The name or identifier of the template to use. - **sizes** (array) - Optional - A list of desired output sizes for the image. - **url** (string) - Optional - A URL for the image source if not using a template. - **batchUrl** (string) - Optional - A URL for batch processing requests. - **webhook** (string) - Optional - A webhook URL to receive notifications upon completion. - **airtableApiKey** (string) - Optional - API key for Airtable integration. - **tweet** (object) - Optional - Tweet object for Twitter integration. - **updateTwitterHeader** (boolean) - Optional - Flag to update Twitter header. - **googleSheetsDocumentId** (string) - Optional - Google Sheets document ID for integration. - **googleSheetsSheetName** (string) - Optional - Google Sheets sheet name for integration. - **useAws** (boolean) - Optional - Flag to use AWS for storage or processing. ### Request Example ```json { "template": "twitter_tweet", "sizes": ["1080x1080", "1920x1080"], "tweet": { "author_name": "John Doe", "author_avatar": "http://example.com/avatar.png", "tweet_text": "This is a test tweet!", "tweet_image": "http://example.com/tweet_image.png" } } ``` ### Response #### Success Response (200) - **id** (string) - The ID of the generated resource or job. - **status** (string) - The current status of the operation. #### Response Example ```json { "id": "job_12345", "status": "pending" } ``` ``` -------------------------------- ### GET /templates Source: https://developers.switchboard.ai/property/request/tweet Retrieves a list of all available templates. ```APIDOC ## GET /templates ### Description Retrieves a list of all available templates within the system. ### Method GET ### Endpoint `/templates` ### Parameters *No parameters required for this endpoint.* ### Request Example ```json {} // No request body for GET requests ``` ### Response #### Success Response (200) - **templates** (array) - A list of available templates. Each template is represented by an object, typically including its name and description. #### Response Example ```json { "templates": [ { "name": "invoice-template", "description": "A template for generating invoices." }, { "name": "social-media-post", "description": "Template for social media updates." } ] } ``` ``` -------------------------------- ### GET /templates Source: https://developers.switchboard.ai/property/request/googleSheetsDocumentId Retrieves a list of all available templates. ```APIDOC ## GET /templates ### Description Retrieves a list of all available templates. ### Method GET ### Endpoint /templates ### Parameters (No parameters for this endpoint) ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **templates** (array) - A list of available templates. Each item in the array is an object containing template information, typically including `name` and `api-name`. #### Response Example ```json { "templates": [ { "name": "Welcome Email", "api-name": "welcome-email-template" }, { "name": "Product Announcement", "api-name": "product-announcement" } ] } ``` ``` -------------------------------- ### GET /templates Source: https://developers.switchboard.ai/docs/shortids Fetches a list of available templates. Use this to discover which templates can be used. ```APIDOC ## GET /templates ### Description Retrieves a list of all available templates. ### Method GET ### Endpoint /templates ### Response #### Success Response (200) - **templates** (array) - An array of template objects, each containing template details like name and description. ``` -------------------------------- ### POST /Root Source: https://developers.switchboard.ai/docs/property-reference This endpoint likely serves as the primary entry point for generating content via the API. It accepts various properties to define the output format, quality, template, and data sources. ```APIDOC ## POST /Root ### Description This endpoint is used to generate content. It accepts various properties to define the output format, quality, template, and data sources for the generated content. ### Method POST ### Endpoint /Root ### Parameters #### Request Body - **format** (text) - Optional - Specifies the desired output format (e.g., text, image). - **quality** (number) - Optional - When format is set to jpg, sets the quality of the resulting image (0.0 - 1.0). - **template** (string) - Required - The API name of the template to use. - **sizes** (array) - Optional - Specifies the desired sizes for the generated output. - **url** (string) - Optional - A URL of a blog post or page to use as a source. - **batchUrl** (string) - Optional - A URL of a resource containing an array of element overwrites for batch processing. - **webhook** (string) - Optional - A URL for a webhook to receive completion notifications for batch processing. - **airtableApiKey** (string) - Optional - An Airtable API key for accessing data. - **tweet** (string) - Optional - A URL to a tweet on twitter.com. - **updateTwitterHeader** (boolean) - Optional - If true, updates the user's Twitter header with an image from the template after authentication. - **googleSheetsDocumentId** (string) - Optional - The ID of a Google Sheets document for batch processing. - **googleSheetsSheetName** (string) - Optional - The name of the Sheet within the Google Sheets document for batch processing. - **useAws** (boolean) - Optional - Determines whether to move the created image to a custom AWS S3 bucket. - **angle** (number) - Optional - The angle of the element within its bounding box (0 - 360). - **fillTextBox** (boolean) - Optional - If true, the text resizes automatically to fit the bounding box. - **fontFamily** (text) - Optional - Specifies the font family for text elements. - **opacity** (number) - Optional - The opacity of the element (0.0 - 1.0). - **horizontalAlignment** (enum) - Optional - The horizontal alignment of the element within its bounding box (`left`, `right`, `center`). - **maximumFontSize** (number) - Optional - The maximum font size to use when fillTextBox is true. - **text** (text) - Optional - The text content for text elements. - **textColor** (string) - Optional - The color of the text. - **translateTo** (enum) - Optional - The language code for text translation (e.g., `fr`). - **backgroundColor** (string) - Optional - The background color when `contain` is true. - **backgroundOpacity** (number) - Optional - The opacity of the background color (0.0 - 1.0). - **contain** (boolean) - Optional - Whether the image is fully contained within its bounding box. - **cornerRadius** (number) - Optional - The size of the corner radius of the image (0 - 50). - **removeBackground** (boolean) - Optional - Uses machine learning to remove the background from the primary subject in an image. - **qrCode** (string) - Optional - A URL to generate a QR code. - **verticalAlignment** (enum) - Optional - The vertical alignment of the element within its bounding box (`top`, `middle`, `bottom`). ### Request Example ```json { "template": "quote", "format": "png", "quality": 0.9, "sizes": ["1080x1080"], "url": "https://example.com/article", "text": { "text": "Hello, Switchboard!", "textColor": "#FFFFFF", "fontSize": 48, "fontFamily": "Arial", "horizontalAlignment": "center", "verticalAlignment": "middle" }, "image": { "url": "https://example.com/logo.png", "opacity": 0.8 } } ``` ### Response #### Success Response (200) - **outputUrl** (string) - A URL to the generated content. - **batchId** (string) - An ID for the batch job if batch processing was initiated. #### Response Example ```json { "outputUrl": "https://cdn.switchboard.ai/output/abcdef12345.png", "batchId": "batch_xyz789" } ``` ``` -------------------------------- ### GET /templates Source: https://developers.switchboard.ai/property/request/updatetwitterheader Retrieves a list of all available templates. ```APIDOC ## GET /templates ### Description Fetches a list of all templates available within the system. ### Method GET ### Endpoint /templates ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ``` GET /templates ``` ### Response #### Success Response (200) - **templates** (array) - A list of available templates. - **template** (object) - Information about a template. - **name** (string) - The name of the template. - **apiName** (string) - The unique API name for the template. #### Response Example ```json { "templates": [ { "name": "Invoice Template", "apiName": "invoice_v1" }, { "name": "Report Template", "apiName": "report_q3" } ] } ``` ``` -------------------------------- ### POST / Request Format - All Options Source: https://developers.switchboard.ai/docs/api This JSON object demonstrates the full range of options available when making a POST request to create images. It includes template details, size configurations, element properties (image, text, rectangle), and integration parameters like URLs, webhooks, and API keys. ```json { "template": "template-api-name", "sizes": [ { "width": 1080, "height": 1080, "elements": { ... } }, { ... } ], "elements": { "image-element": { "angle": 45, "backgroundColor": "#FF0000", "backgroundOpacity": 0.5, "contain": true, "cornerRadius": 20, "fill": true, "fillColor": "#0000FF", "horizontalAlignment": "left", "lut": "https://example.com/effect.lut", "opacity": 0.5, "qrCode": "A value to be encoded in the QR code image", "url": "https://example.com/image.jpg", "verticalAlignment": "top" }, "text-element": { "angle": 45, "fillTextBox": true, "horizontalAlignment": "left", "minimumFontSize": 65, "opacity": 0.5, "text": "This is some text", "textBackgroundColor": "#00FFFF", "textBackgroundHeight": 0.5, "textBackgroundPadding": 50, "textColor": "#FFFFFF", "textHighlightColor": "#00FF00", "textLetterSpacing": -250, "translateTo": "it", "verticalAlignment": "top" }, "rectangle-element": { "angle": 45, "opacity": 0.5, "fillColor": "#0000FF", "strokeColor": "#000000", "strokeWidth": 20, "backgroundTransparent": true } }, "url": "https://example.com/blog-post.html", "batchUrl": "https://example.com/batch-data.json", "webhook": "https://example.com/webhook", "airtableApiKey": "airtable-api-key", "tweet": "https://twitter.com/switchboardai/status/1442852092159217668", "updateTwitterHeader": true } ``` -------------------------------- ### POST / Source: https://developers.switchboard.ai/property/rectangle/fillcolor This endpoint is used for initiating a root-level operation, likely related to creating or processing data. ```APIDOC ## POST / ### Description This endpoint is used for initiating a root-level operation, likely related to creating or processing data. ### Method POST ### Endpoint / ### Parameters #### Query Parameters - **format** (string) - Optional - Specifies the desired output format. - **quality** (string) - Optional - Defines the quality setting for the operation. - **template** (string) - Optional - The name or identifier of a template to be used. - **sizes** (string) - Optional - Specifies the desired output sizes. - **url** (string) - Optional - A URL for input data or resources. - **batchUrl** (string) - Optional - A URL for batch processing related data. - **webhook** (string) - Optional - A webhook URL for asynchronous notifications. - **airtableApiKey** (string) - Optional - API key for Airtable integration. - **tweet** (string) - Optional - Content or identifier for a tweet. - **updateTwitterHeader** (boolean) - Optional - Flag to indicate if Twitter header should be updated. - **googleSheetsDocumentId** (string) - Optional - The ID of a Google Sheets document. - **googleSheetsSheetName** (string) - Optional - The name of the sheet within a Google Sheets document. - **useAws** (boolean) - Optional - Flag to indicate if AWS services should be used. ### Request Body * **text** (object) - Optional - Configuration for text properties. - **angle** (number) - Optional - Rotation angle for the text. - **fillTextBox** (boolean) - Optional - Whether to fill the text bounding box. - **fontFamily** (string) - Optional - The font family to use for the text. - **opacity** (number) - Optional - The opacity of the text. - **horizontalAlignment** (string) - Optional - Horizontal alignment of the text. - **maximumFontSize** (number) - Optional - The maximum font size for the text. - **text** (string) - Optional - The text content. - **textColor** (string) - Optional - The color of the text. - **translateTo** (string) - Optional - Language code to translate the text to. * **image** (object) - Optional - Configuration for image properties. - **angle** (number) - Optional - Rotation angle for the image. - **backgroundColor** (string) - Optional - Background color for the image. - **backgroundOpacity** (number) - Optional - Opacity of the image background. - **contain** (boolean) - Optional - Whether the image should be contained within its bounds. - **cornerRadius** (number) - Optional - Corner radius for the image. - **horizontalAlignment** (string) - Optional - Horizontal alignment of the image. - **opacity** (number) - Optional - The opacity of the image. - **removeBackground** (boolean) - Optional - Whether to remove the image background. - **url** (string) - Optional - URL of the image. - **qrCode** (boolean) - Optional - Whether to process the image as a QR code. - **verticalAlignment** (string) - Optional - Vertical alignment of the image. * **rectangle** (object) - Optional - Configuration for rectangle properties. - **angle** (number) - Optional - Rotation angle for the rectangle. - **fillColor** (string) - Optional - The fill color of the rectangle. - **opacity** (number) - Optional - The opacity of the rectangle. ### Request Example ```json { "request": { "template": "my-template", "sizes": "1080x1920" }, "text": { "text": "Hello, World!", "textColor": "#FFFFFF", "fontSize": 48 }, "image": { "url": "https://example.com/image.jpg" } } ``` ### Response #### Success Response (200) - **result** (object) - Details about the operation result. - **status** (string) - The status of the operation (e.g., "success", "pending"). - **id** (string) - An identifier for the operation. - **outputUrl** (string) - URL to the generated output. #### Response Example ```json { "result": { "status": "success", "id": "op-12345", "outputUrl": "https://example.com/output.png" } } ``` ``` -------------------------------- ### GET /templates Source: https://developers.switchboard.ai/property/request/googleSheetsSheetName Retrieves a list of all available templates. ```APIDOC ## GET /templates ### Description Returns a list of all templates that are available for use within the system. ### Method GET ### Endpoint /templates ### Parameters None ### Request Example ``` GET /templates ``` ### Response #### Success Response (200) - **templates** (array) - A list of available template objects. - Each template object typically includes its name and API name. #### Response Example ```json { "templates": [ {"name": "Welcome Banner", "apiName": "welcome-banner"}, {"name": "Product Ad", "apiName": "product-ad"} ] } ``` ``` -------------------------------- ### JSON Request Example for Image Processing Source: https://developers.switchboard.ai/property/image/url This JSON object demonstrates a sample request to the Switchboard AI API for image processing. It specifies the template to use, desired sizes, and configurations for various elements including images, which can be provided via URL or a library identifier. ```json { "template": "sample-image", "sizes": [ { "width": 1080, "height": 1080 } ], "elements": { "image1": { "url": "https://via.placeholder.com/500/500" }, "image2": { "url": "jxnfTsjeWI" } } } ``` -------------------------------- ### Template Management API Source: https://developers.switchboard.ai/docs/keyboard-shortcuts Endpoints for managing templates and their elements. Includes creating templates, retrieving template elements by name, and listing all available templates. ```APIDOC ## POST / ### Description Creates a new template. ### Method POST ### Endpoint / ### Parameters #### Request Body - **format** (string) - Required - The format of the template. - **quality** (string) - Optional - The quality of the template. - **template** (object) - Required - The template object containing properties. - **sizes** (array) - Optional - An array of supported sizes. - **url** (string) - Optional - A URL for the template. - **batchUrl** (string) - Optional - A batch URL for the template. - **webhook** (string) - Optional - A webhook URL. - **airtableApiKey** (string) - Optional - Airtable API key. - **tweet** (string) - Optional - Tweet content. - **updateTwitterHeader** (boolean) - Optional - Whether to update Twitter header. - **googleSheetsDocumentId** (string) - Optional - Google Sheets document ID. - **googleSheetsSheetName** (string) - Optional - Google Sheets sheet name. - **useAws** (boolean) - Optional - Whether to use AWS. ### Request Example ```json { "format": "png", "quality": "high", "template": { "text": { "angle": 0, "fillTextBox": true, "fontFamily": "Arial", "opacity": 1, "horizontalAlignment": "center", "maximumFontSize": 24, "text": "Hello, World!", "textColor": "#000000", "translateTo": "en" }, "image": { "angle": 0, "backgroundColor": "#FFFFFF", "backgroundOpacity": 1, "contain": true, "cornerRadius": 0, "horizontalAlignment": "center", "opacity": 1, "removeBackground": false, "url": "https://example.com/image.jpg", "qrCode": null, "verticalAlignment": "center" }, "rectangle": { "angle": 0, "fillColor": "#CCCCCC", "opacity": 0.5 } }, "sizes": ["1920x1080", "1080x1920"], "url": "https://example.com/template.json", "webhook": "https://example.com/webhook", "airtableApiKey": "your_airtable_api_key", "tweet": "Check out this new template!", "updateTwitterHeader": true, "googleSheetsDocumentId": "your_doc_id", "googleSheetsSheetName": "Sheet1", "useAws": false } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Template created successfully." } ``` ``` ```APIDOC ## GET /template//elements ### Description Retrieves elements of a specific template. ### Method GET ### Endpoint /template//elements ### Parameters #### Path Parameters - **api-name** (string) - Required - The name of the template. ### Response #### Success Response (200) - **elements** (object) - An object containing the template elements. #### Response Example ```json { "elements": { "text": { "angle": 0, "fillTextBox": true, "fontFamily": "Arial", "opacity": 1, "horizontalAlignment": "center", "maximumFontSize": 24, "text": "Hello, World!", "textColor": "#000000", "translateTo": "en" }, "image": { "angle": 0, "backgroundColor": "#FFFFFF", "backgroundOpacity": 1, "contain": true, "cornerRadius": 0, "horizontalAlignment": "center", "opacity": 1, "removeBackground": false, "url": "https://example.com/image.jpg", "qrCode": null, "verticalAlignment": "center" }, "rectangle": { "angle": 0, "fillColor": "#CCCCCC", "opacity": 0.5 } } } ``` ``` ```APIDOC ## GET /templates ### Description Retrieves a list of all available templates. ### Method GET ### Endpoint /templates ### Response #### Success Response (200) - **templates** (array) - An array of template objects. #### Response Example ```json { "templates": [ { "name": "template1", "description": "A sample template" }, { "name": "template2", "description": "Another sample template" } ] } ``` ```