### OpenAPI Example for Message Input Source: https://partner-docs.gupshup.io/reference/interactive-1 Provides an example of a valid input object for sending a message. ```json { "input": "DESTINATION_PHONE_NO", "wa_id": "DESTINATION_PHONE_NO" } ``` -------------------------------- ### Postback Texts Example Source: https://partner-docs.gupshup.io/reference/post_partner-app-appid-template-msg An example of postback texts for quick reply buttons. This shows how to provide multiple quick reply options with their respective indices. ```json [{"index":4,"text":"hello"},{"index":5,"text":"hey"}] ``` -------------------------------- ### Sample Response for Get Business Profile About Source: https://partner-docs.gupshup.io/reference/get_partner-app-appid-business-profile-about This is an example of a successful JSON response when retrieving the 'About' text. The actual business description will be in place of ''. ```json { "about": { "message": "" }, "status": "success" } ``` -------------------------------- ### Message Example Source: https://partner-docs.gupshup.io/reference/post_partner-app-appid-v3-message-7 An example of a message object. ```json { "id": "GUPSHUP_MESSAGE_ID" } ``` -------------------------------- ### Unblock Users Request Example Source: https://partner-docs.gupshup.io/reference/post_partner-app-appid-user-unblock This example shows the structure of a request to unblock one or more users for a specified app. It includes the messaging product and a list of users to unblock. ```json { "messaging_product": "whatsapp", "block_users": [ { "user": "919163805873" } ] } ``` -------------------------------- ### OpenAPI Schema Example Source: https://partner-docs.gupshup.io/reference/post_partner-app-appid-conversational-component Illustrates an integer type with a specific example value within an OpenAPI schema definition. ```json { "type": "integer", "example": 500 } ``` -------------------------------- ### Get App Details Request Source: https://partner-docs.gupshup.io/reference/get_partner-app-appid-details Use this cURL command to make a GET request to fetch app details. Ensure you replace placeholders with your actual PARTNER_TOKEN and appId. ```curl curl --location --request GET '{{partner_portal_base_url}}/partner/app/:appId/details' \ --header 'token: {{PARTNER_TOKEN}}' ``` -------------------------------- ### Sample Request to Create Template from Library Source: https://partner-docs.gupshup.io/reference/createtemplatefromlibrary_3 This cURL command demonstrates how to make a POST request to create a new template using a pre-approved Meta Library template. Ensure you replace placeholders like :appId, {{PARTNER_APP_TOKEN}}, and other data-urlencode parameters with your specific values. ```curl curl --location --request POST 'https://partner.gupshup.io/partner/app/:appId/template/metalibrary' \ --header 'Authorization: {{PARTNER_APP_TOKEN}}' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'elementName={{NEW_ELEMENT_NAME}}' \ --data-urlencode 'category=UTILITY' \ --data-urlencode 'languageCode={{LANGUAGE_CODE_OF_LIBRARY_TEMPLATE}}' \ --data-urlencode 'libraryTemplateName={{NAME_OF_LIBRARY_TEMPLATE}}' \ --data-urlencode 'buttons={{BUTTONS_IN_SAME_FORMAT_LIKE_LIBRARY_TEMPLATE}}}' ``` -------------------------------- ### Get Template Comparison Analytics Source: https://partner-docs.gupshup.io/reference/get_partner-app-appid-template-analytics-templateid-compare Retrieves analytics data for a specific template, allowing comparison over a defined period. You can specify start and end timestamps to define the comparison window. ```APIDOC ## GET /partner/app/{appId}/template/analytics/templateId/compare ### Description Retrieves analytics data for a specific template, allowing comparison over a defined period. You can specify start and end timestamps to define the comparison window. ### Method GET ### Endpoint /partner/app/{appId}/template/analytics/templateId/compare ### Parameters #### Query Parameters - **start_timestamp** (integer) - Required - The start of the time range for analytics data in Unix timestamp format. - **end_timestamp** (integer) - Required - The end of the time range for analytics data in Unix timestamp format. ### Response #### Success Response (200) - **data** (object) - Contains the analytics data for the specified template and time range. - **template_id** (string) - The ID of the template. - **app_id** (string) - The ID of the application. - **start_timestamp** (integer) - The start timestamp of the data range. - **end_timestamp** (integer) - The end timestamp of the data range. - **views** (integer) - The number of times the template was viewed. - **clicks** (integer) - The number of times the template was clicked. - **conversions** (integer) - The number of conversions attributed to the template. #### Response Example ```json { "data": { "template_id": "tpl_12345", "app_id": "app_abcde", "start_timestamp": 1678886400, "end_timestamp": 1679059200, "views": 1500, "clicks": 300, "conversions": 50 } } ``` #### Error Response (400) - **status** (string) - Indicates an error occurred. - **message** (string) - Provides details about the error. #### Error Response Example (Bad Request - Invalid Timestamp Range) ```json { "status": "error", "message": "The parameter start_timestamp should be less than end_timestamp." } ``` #### Error Response Example (Bad Request - Invalid Time Difference) ```json { "status": "error", "message": "The difference between start and end times should be the number of seconds in 7, 30, 60 or 90 days." } ``` #### Error Response Example (Bad Request - Template Not Approved) ```json { "status": "error", "message": "One or more templates in the list is not approved." } ``` ``` -------------------------------- ### Sample Response for Fetching Templates Source: https://partner-docs.gupshup.io/reference/gettemplatesfromlibrary_3 This is an example of a successful response when fetching Meta Library Templates. It includes template details such as category, element name, industry, language code, topic, and use case. ```json { "status": "success", "templates": [ { "category": "UTILITY", "containerMeta": "sampleData", "data": "sampleData", "elementName": "account_creation_confirmation_3", "industry": "E_COMMERCE,FINANCIAL_SERVICES", "languageCode": "nb", "topic": "ACCOUNT_UPDATES", "usecase": "ACCOUNT_CREATION_CONFIRMATION" } ] } ``` -------------------------------- ### Sample Subscription Response Source: https://partner-docs.gupshup.io/reference/get_partner-app-appid-subscription-subscriptionid This is an example of a successful response when retrieving a specific app subscription. It includes details such as activation status, creation date, latency buckets, and the subscription URL. ```json { "status" : "success", "subscription" : { "active" : true, "appId" : "657c0203-0b4d-4ba1-bbf5-a679cfa35a16", "createdOn" : 1739862125507, "id" : "32595", "latencyBucket" : "lt_1_s", "mode" : 1025, "modes" : [ "SENT", "ENQUEUED" ], "modifiedOn" : 1739870558358, "showOnUI" : false, "tag" : "V33i4", "url" : "https://01hqjda5pbywgv7xw5e9ckd5e800-51132d4cc32709e9078d.requestinspector.com", "version" : 2 } } ``` -------------------------------- ### OpenAPI Definition for Get Profile About Source: https://partner-docs.gupshup.io/reference/get_partner-app-appid-business-profile-about This OpenAPI 3.0.3 definition outlines the GET request for the 'APP | get profile about' endpoint, including parameters and possible responses. ```json { "openapi": "3.0.3", "info": { "title": "Partner Portal Public APIs", "version": "1.0.0" }, "servers": [ { "url": "https://partner.gupshup.io" } ], "tags": [ { "name": "App" } ], "paths": { "/partner/app/{appId}/business/profile/about": { "get": { "tags": [ "App" ], "summary": "APP | get profile about", "parameters": [ { "name": "Authorization", "in": "header", "schema": { "type": "string" }, "example": "{{PARTNER_APP_TOKEN}}" }, { "name": "appId", "in": "path", "schema": { "type": "string" }, "required": true, "example": "04e6c66b-bb95-4bfc-b75e-4e7391ddc680" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": {} } }, "400": { "description": "Bad request", "content": { "application/json": {} } }, "401": { "description": "Unauthorized", "content": { "application/json": {} } }, "500": { "description": "Internal server error", "content": { "application/json": {} } } } } } }, "x-readme": { "explorer-enabled": true, "proxy-enabled": true } } ``` -------------------------------- ### POST /partner/app Source: https://partner-docs.gupshup.io/reference/post_partner-app Creates a new WABA onboarding instance. This endpoint requires authentication via a Partner JWT Token and accepts application details such as name, and feature toggles for template messaging and opt-in preferences. ```APIDOC ## POST /partner/app ### Description Creates a new WABA onboarding instance outside of the Gupshup UI. This API requires a valid Partner JWT Token for authentication and allows configuration of the new app's name and feature flags. ### Method POST ### Endpoint /partner/app ### Parameters #### Header Parameters - **token** (string) - Required - JWT Token issued after Partner login. #### Request Body - **name** (string) - Required - Name for the app. Constraints: 6-150 characters, no special characters, must be unique. - **templateMessaging** (boolean) - Optional - Toggles the template messaging feature. Defaults to false if not provided. - **disableOptinPrefUrl** (boolean) - Optional - Toggles the opt-in preferences feature. See [Mark User Optin or Optout](https://partner-docs.gupshup.io/reference/put_partner-app-appid-optin) for more details. ### Request Example ```curl curl --location --request POST '{{partner_portal_base_url}}/partner/app' \ --header 'token: {{PARTNER_TOKEN}}' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'name={{appName}}' \ --data-urlencode 'templateMessaging=' \ --data-urlencode 'disableOptinPrefUrl=' ``` ### Response #### Success Response (200) - **appId** (string) - The unique identifier for the newly created app. #### Response Example ```json { "appId": "" } ``` ### Error Handling - **400 Bad Request**: Invalid characters in app name, or app name length is outside the 6-150 character constraint. - **409 Conflict**: A bot with the same name already exists. - **429 Too Many Requests**: Rate limit exceeded (10 requests per minute). - **500 Internal Server Error**: Unable to create the app due to an internal server issue. ``` -------------------------------- ### OpenAPI Definition - Success Response Example Source: https://partner-docs.gupshup.io/reference/post_partner-app-appid-templates-carouselvideo This snippet shows an example of a successful response structure, including the 'wabaId'. ```json { "wabaId": { "type": "string", "example": "104505526065633" } } ``` -------------------------------- ### Create Partner App Request Source: https://partner-docs.gupshup.io/reference/post_partner-app Use this cURL command to create a new WABA onboarding application. Ensure you replace placeholders like {{PARTNER_TOKEN}}, {{appName}}, and with your actual values. ```curl curl --location --request POST '{{partner_portal_base_url}}/partner/app' \ --header 'token: {{PARTNER_TOKEN}}' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'name={{appName}}' \ --data-urlencode 'templateMessaging=' \ --data-urlencode 'disableOptinPrefUrl=' ``` -------------------------------- ### Sample App Discount Response Source: https://partner-docs.gupshup.io/reference/get_partner-app-appid-discount This JSON response shows the daily discount and billing details for an application, including cumulative bill, daily bill, day, discount, Gupshup fees, and caps for a given month and year. ```json { "dailyAppDiscountList":[ { "appId":"8*****j7-a**3-4**d-8***-c2******7bf**3", "cumulativeBill":0, "dailyBill":0, "day":2, "discount":0, "gsCap":75, "gsFees":0, "month":4, "partnerId":15, "year":2022 }, { "appId":"8*****j7-a**3-4**d-8***-c2******7bf**3", "cumulativeBill":0.014, "dailyBill":0.014, "day":4, "discount":0, "gsCap":75, "gsFees":0.014, "month":4, "partnerId":15, "year":2022 } ] } ``` -------------------------------- ### OpenAPI Schema Example Source: https://partner-docs.gupshup.io/reference/post_partner-app-appid-v3-flow-message-6 This snippet shows an example of an OpenAPI schema definition for a response, including properties like 'message' and 'status'. ```json { "type": "object", "properties": { "message": { "type": "string", "example": "Callback Billing must be enabled for this API" }, "status": { "type": "string", "example": "error" } } } ``` -------------------------------- ### Example Carousel Image Card with Buttons Source: https://partner-docs.gupshup.io/reference/post_partner-app-appid-templates-carouselimage An example of a carousel image card demonstrating the use of both URL and Quick Reply buttons. ```json `\[{\"headerType\":\"IMAGE\",\"mediaUrl\":\"\",\"mediaId\":null,\"exampleMedia\":null,\"body\":\"New> Year is round the corner {{1}}\",\"sampleText\":\"New Year is round the corner User\",\"buttons\":\[{\"type\":\"URL\",\"text\":\"Buy now\",\"url\":\"\",\"buttonValue\":\"https://www.luckyshrub.com/shop?promo=\",\"suffix\":\"exotic_produce_2023\",\"example\":\[\"https://www.luckyshrub.com/shop?promo=exotic_produce_2023\"]},{\"type\":\"QUICK_REPLY\",\"text\":\"Send> more like this\"}]}` ``` -------------------------------- ### Create App Source: https://partner-docs.gupshup.io/reference/app-onboarding-apis This API is used to create a new WABA onboarding outside of Gupshup UI. ```APIDOC ## POST /partner/app ### Description This API is used to create a new WABA onboarding outside of Gupshup UI. ### Method POST ### Endpoint /partner/app ``` -------------------------------- ### Carousel Message Example Source: https://partner-docs.gupshup.io/reference/post_partner-app-appid-template-msg An example of a carousel message with an image card and a postback button. This demonstrates how to structure the message for a specific carousel layout. ```json { "type": "carousel", "cardHeaderType": "IMAGE", "cards": [ { "link": "", "postbackTexts": [ { "index": 1, "text": "hello" } ] } ]} ``` -------------------------------- ### App Usage Response Example Source: https://partner-docs.gupshup.io/reference/get_partner-app-appid-usage This JSON response details the daily usage for a partner application, including message counts, fees, and billing information for a specific date. ```json { "status": "success", "partnerAppUsageList": [ { "appId": "bf9ee64c-3d4d-4ac4-8668-732e577007c4", "appName": "Jan10pass", "authentication": 0, "cumulativeBill": 0.007, "currency": "USD", "date": "2024-01-10", "discount": 0.0, "fep": 0, "ftc": 1, "gsCap": 75.0, "gsFees": 0.007, "incomingMsg": 2, "outgoingMsg": 4, "outgoingMediaMsg": 0, "marketing": 0, "service": 0, "templateMsg": 0, "templateMediaMsg": 1, "totalFees": 0.007, "totalMsg": 7, "utility": 0, "waFees": 0.0, "internationalAuthentication": 1 }, { "appId": "bf9ee64c-3d4d-4ac4-8668-732e577007c4", "appName": "Jan10pass", "authentication": 0, "cumulativeBill": 0.234, "currency": "USD", "date": "2024-01-18", "discount": 0.0, "fep": 0, "ftc": 1, "gsCap": 75.0, "gsFees": 0.091, "incomingMsg": 9, "outgoingMsg": 82, "outgoingMediaMsg": 0, "marketing": 1, "service": 0, "templateMsg": 0, "templateMediaMsg": 0, "totalFees": 0.101, "totalMsg": 91, "utility": 0, "waFees": 0.01, "internationalAuthentication": 1 } ] } ``` -------------------------------- ### Alternative cURL Request for Get Partner Apps Source: https://partner-docs.gupshup.io/reference An alternative cURL request for the Get Partner Apps endpoint, specifying the accept header. ```shell curl --request GET \ --url https://partner.gupshup.io/partner/account/api/partnerApps \ --header 'accept: application/json' ``` -------------------------------- ### Message API Request Example Source: https://partner-docs.gupshup.io/reference/post_partner-app-appid-v3-message-13 This example shows the structure of a valid request to send a message, including destination phone number and WA ID. ```json { "input": "DESTINATION_PHONE_NO", "wa_id": "DESTINATION_PHONE_NO" } ``` -------------------------------- ### Fetch Meta Library Templates Source: https://partner-docs.gupshup.io/reference/gettemplatesfromlibrary_3 Use this cURL command to fetch pre-approved Meta Library Templates for your application. Ensure you replace placeholders like :appId and {{PARTNER_APP_TOKEN}} with your actual values. ```curl curl --location 'https://partner.gupshup.io/partner/app/:appId/template/metalibrary?elementName=&industry=&languageCode=&topic=&usecase=' --header 'Authorization : {{PARTNER_APP_TOKEN}}' ``` -------------------------------- ### POST /partner-app/{appId}/templates/product Source: https://partner-docs.gupshup.io/reference/post_partner-app-appid-templates-product Creates a new product template for a partner application. This endpoint requires authentication and specific template details. ```APIDOC ## POST /partner-app/{appId}/templates/product ### Description Creates a new product template for a partner application. This endpoint requires authentication and specific template details. ### Method POST ### Endpoint /partner-app/{appId}/templates/product ### Parameters #### Request Body - **elementName** (String) - Required - The name of a template. The element name is unique for a WABAs namespace (not more than 180 char.). - **content** (String) - Required - The body of the template (not more than 1024 char.). - **category** (String) - Required - The category of your template. Category Type: MARKETING, UTILITY. - **vertical** (String) - Required - Vertical (not more than 180 char.). - **templateType** (String) - Required - The type of template: PRODUCT. - **example** (String) - Required - Template Example. - **enableSample** (Boolean) - Required - Required for creating all types of templates (true/false). - **languageCode** (String) - Optional - Language code for the template. Default value: `en_US`. ### Request Example ```json { "elementName": "{{ELEMENT_NAME}}", "languageCode": "{{LANGUAGE_CODE}}", "content": "{{CONTENT}}", "category": "{{CATEGORY}}", "vertical": "{{VARTICAL}}", "templateType": "{{TEMPLATE_TYPE}}", "example": "{{EXAMPLE}}", "enableSample": {{ENABLE_SAMPLE}} } ``` ### Headers - **Authorization** (String) - Required - Access Token for the application. Should be a valid Partner App Access Token. ``` -------------------------------- ### Unblock Users Successful Response Example Source: https://partner-docs.gupshup.io/reference/post_partner-app-appid-user-unblock This example illustrates a successful response when users are unblocked. It lists the users that were successfully removed from the block list. ```json { "block_users": { "removed_users": [ { "input": "919163805873", "wa_id": "919163805873" } ] }, "messaging_product": "whatsapp", "status": "success" } ``` -------------------------------- ### POST /partner/app/{appId}/templates Source: https://partner-docs.gupshup.io/reference/creategiftemplate Creates a new GIF template. The template will be created with status 'PENDING' and requires approval. Element name must be unique for the WABA's namespace. Videos must be under 3.5 MB. ```APIDOC ## POST /partner/app/{appId}/templates ### Description Creates a new GIF template for WhatsApp Business API messaging. The template will be initially set to 'PENDING' status and requires Meta approval. Ensure the `elementName` is unique within the WABA's namespace. Videos used in the template must not exceed 3.5 MB. ### Method POST ### Endpoint https://qa-partner-api.smsgupshup.dev/partner/app/{appId}/templates ### Parameters #### Path Parameters - **appId** (string) - Required - The ID of the application. #### Form Data Parameters - **elementName** (string) - Required - A unique name for the template within the WABA's namespace. - **languageCode** (string) - Required - The language code for the template (e.g., 'en'). - **content** (string) - Required - The main content of the template message. - **footer** (string) - Optional - The footer text for the template. - **category** (string) - Required - The category of the template (e.g., 'MARKETING'). - **templateType** (string) - Required - The type of template, must be 'GIF'. - **vertical** (string) - Required - The vertical associated with the template (e.g., 'update_shop'). - **example** (string) - Required - An example of the template content. - **mediaId** (string) - Required - The ID of the media to be used. - **mediaUrl** (string) - Required - The URL of the media (video) to be used. Must be under 3.5 MB. - **enableSample** (boolean) - Optional - Whether to enable a sample for the template. ### Request Example ``` curl --request POST \ --url https://qa-partner-api.smsgupshup.dev/partner/app/bf9ee64c-3d4d-4ac4-8668-732e577007c4/templates \ --header 'Authorization: sk_852356fadaab4eefb679845237c85213' \ --header 'content-type: application/x-www-form-urlencoded' \ --data elementName=avida_gif_template \ --data languageCode=en \ --data 'content=This is my first GIF template' \ --data 'footer=Hello GIF' \ --data category=MARKETING \ --data templateType=GIF \ --data vertical=update_shop \ --data 'example=This is my first GIF template' \ --data mediaId=8fa96b2c-744e-4acf-bc98-9d4cd66bdd34 \ --data 'mediaUrl="https://d2kq6t3nveviav.cloudfront.net/0/public/0/0/gupshup/918097424541/8fa96b2c-744e-4acf-bc98-9d4cd66bdd34/1767777627749_sample01.mp4"' \ --data enableSample=true ``` ### Response #### Success Response (200) - **status** (string) - Indicates the status of the request (e.g., 'success'). - **templates** (array) - An array containing details of the created template(s). - **appId** (string) - The ID of the application. - **category** (string) - The category of the template. - **createdOn** (integer) - Timestamp when the template was created. - **data** (string) - The main content of the template. - **elementName** (string) - The unique name of the template element. - **externalId** (string) - The external ID of the template. - **id** (string) - The unique ID of the template. - **languageCode** (string) - The language code of the template. - **meta** (string) - Metadata associated with the template. - **modifiedOn** (integer) - Timestamp when the template was last modified. - **namespace** (string) - The namespace for the template. - **parameterFormat** (string) - The format of parameters used in the template. - **status** (string) - The approval status of the template (e.g., 'APPROVED', 'PENDING'). - **templateType** (string) - The type of the template (e.g., 'GIF'). - **vertical** (string) - The vertical associated with the template. - **wabaId** (string) - The WhatsApp Business Account ID. #### Response Example ```json { "status": "success", "templates": [ { "appId": "bf9ee64c-3d4d-4ac4-8668-732e577007c4", "category": "MARKETING", "containerMeta": "{\"appId\":\"bf9ee64c-3d4d-4ac4-8668-732e577007c4\",\"data\":\"This is my first GIF template\",\"footer\":\"Hello GIF\",\"sampleText\":\"This is my first GIF template\",\"enableSample\":true,\"mediaId\":\"8fa96b2c-744e-4acf-bc98-9d4cd66bdd34\",\"mediaUrl\":\"https://d2kq6t3nveviav.cloudfront.net/0/public/0/0/gupshup/918097424541/8fa96b2c-744e-4acf-bc98-9d4cd66bdd34/1767777627749_sample01.mp4\",\"editTemplate\":false,\"allowTemplateCategoryChange\":false,\"addSecurityRecommendation\":false,\"isCPR\":false,\"cpr\":false}", "createdOn": 1769600654568, "data": "This is my first GIF template\nHello GIF", "elementName": "avida_gif_template", "externalId": "869249462577731", "id": "2ae16d34-f644-4c14-9396-568b89450ff2", "internalCategory": 0, "internalType": 0, "languageCode": "en", "languagePolicy": "deterministic", "meta": "{\"example\":\"This is my first GIF template\",\"mediaId\":\"8fa96b2c-744e-4acf-bc98-9d4cd66bdd34\",\"mediaUrl\":\"https://d2kq6t3nveviav.cloudfront.net/0/public/0/0/gupshup/918097424541/8fa96b2c-744e-4acf-bc98-9d4cd66bdd34/1767777627749_sample01.mp4\"}", "modifiedOn": 1769600757736, "namespace": "18cfa544_9c62_4dcd_b8f3_b3785d8c917c", "parameterFormat": "POSITIONAL", "priority": 1, "quality": "UNKNOWN", "retry": 0, "stage": "NONE", "state": "ACTIVE", "status": "APPROVED", "templateType": "GIF", "vertical": "update_shop", "wabaId": "216141188246170" } ] } ``` ``` -------------------------------- ### Get Flow JSON Source: https://partner-docs.gupshup.io/reference/getflowjson Retrieves the JSON asset for a given flow ID. This is a GET request that requires authentication and specific app and flow identifiers. ```APIDOC ## GET /partner/app/{{APP_ID}}/flows/{{FLOW_ID}}/assets ### Description Retrieves the JSON asset for a specific flow. This endpoint is used to get the flow's JSON representation. ### Method GET ### Endpoint /partner/app/{{APP_ID}}/flows/{{FLOW_ID}}/assets ### Parameters #### Path Parameters - **APP_ID** (string) - Required - The ID of the application. - **FLOW_ID** (string) - Required - The ID of the flow. #### Query Parameters None #### Request Body None ### Request Example ```curl curl --location --request GET 'https://partner.gupshup.io/partner/app/{{APP_ID}}/flows/{{FLOW_ID}}/assets' \ --header 'Authorization: {{PARTNER_APP_TOKEN}}' \ --header 'Content-Type: application/json' ``` ### Response #### Success Response (200) - **asset_type** (string) - Type of the asset, expected to be FLOW_JSON. - **download_url** (string) - A URL to download the flow JSON file. - **name** (string) - The name of the asset file, typically 'flow.json'. #### Response Example ```json [ { "asset_type": "FLOW_JSON", "download_url": "https://mmg.whatsapp.net/m1/v/t24/An9xSDGdyGcW0nTRCOYpSKqDhpPeFj1_tKBxswuOYC6DzClzkb3K28561rl0WVKF-go0gzdaAz7H4GRaMaL6b0bLmWG2yH77Vsj40Zv2gjR0NuNMV0B60qqb3fnsT8aQRnM?ccb=10-5&oh=01_Q5AaIJC0sV_X8sXaonaGes0uh3_AVS5aAhgI4OTOYVER7v7H&oe=669CC7C9&_nc_sid=471a72", "name": "flow.json" } ] ``` #### Error Response (400) - **status** (string) - Indicates an error occurred. - **message** (string) - Description of the error, e.g., 'Unsupported get request. Object with ID '...' does not exist...'. #### Error Response Example (400) ```json { "status": "error", "message": "Unsupported get request. Object with ID '52635765283582' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api" } ``` ``` -------------------------------- ### OpenAPI Definition - Error Response Example Source: https://partner-docs.gupshup.io/reference/post_partner-app-appid-v3-message-4 This snippet shows an example of an error response structure within the OpenAPI definition. It includes a 'message' and 'status' field. ```json { "message": { "type": "string", "example": "Callback Billing must be enabled for this API" }, "status": { "type": "string", "example": "error" } } ``` -------------------------------- ### Product Template Creation Response Source: https://partner-docs.gupshup.io/reference/post_partner-app-appid-templates-product This is a sample JSON response received after successfully creating a product template. It includes details about the template's status, metadata, and configuration. ```json { "status": "success", "template": { "appId": "a41b30f4-d202-4fdb-911e-3a8fbfbfb797", "buttonSupported": "MPM", "category": "MARKETING", "containerMeta": "{\"appId\":\"a41b30f4-d202-4fdb-911e-3a8fbfbfb797\",\"data\":\"Dear Customer, Here are our products. \\nThanks for shopping with us\",\"buttons\":[{\"type\":\"MPM\",\"text\":\"View items\"}],\"header\":\"Hi All\",\"footer\":\"This is footer\",\"sampleText\":\"Dear Customer, Here are our products. \\nThanks for shopping with us\",\"sampleHeader\":\"Hi All\",\"enableSample\":true,\"editTemplate\":false,\"allowTemplateCategoryChange\":true,\"addSecurityRecommendation\":false}", "createdOn": 1710799689011, "data": "Hi All\nDear Customer, Here are our products. \\nThanks for shopping with us\nThis is footer | [View items]", "elementName": "automation_template_439231", "id": "1f7871fc-2933-41dd-8f67-ab2a75f055fa", "languageCode": "en", "languagePolicy": "deterministic", "meta": "{\"example\":\"Dear Customer, Here are our products. \\nThanks for shopping with us\"}", "modifiedOn": 1710799689011, "namespace": "9c7fe92f_2a48_40ec_83d0_69c62a772433", "priority": 1, "quality": "UNKNOWN", "retry": 0, "stage": "NONE", "status": "PENDING", "templateType": "PRODUCT", "vertical": "Internal_vertical", "wabaId": "104505526065633" } } ``` -------------------------------- ### MM Lite Onboarding Link Response Source: https://partner-docs.gupshup.io/reference/getmmlitelink This is a sample successful response when requesting an MM Lite onboarding link. It contains the generated link and a success status. ```json { "link": "https://gs.tc.im/mvf6", "status": "success" } ``` -------------------------------- ### Get App Details by App ID Source: https://partner-docs.gupshup.io/reference/get_partner-app-appid-details This snippet shows how to retrieve app details using the GET method with the partner's JWT token and the specific app ID. ```APIDOC ## GET /partner/app/:appId/details ### Description Fetches the details of a specific app using its unique identifier (appId). ### Method GET ### Endpoint `/partner/app/:appId/details` ### Parameters #### Header Parameters - **token** (String) - Required - JWT Token issues post Partner login. Should be a valid Partner JWT Token. #### Path Parameters - **appId** (String) - Required - The id of the app for which data is to be fetched. The id should be a valid app Id of gupshup and the app should be in the account whose PARTNER_TOKEN is being used. ### Request Example ```curl curl --location --request GET '{{partner_portal_base_url}}/partner/app/:appId/details' \ --header 'token: {{PARTNER_TOKEN}}' ``` ### Response #### Success Response (200) - **status** (String) - Indicates the status of the request, e.g., "success". - **appDetails** (Object) - An object containing the detailed information of the app. - **billingType** (String) - The billing type of the app (e.g., "POSTPAID", "PREPAID"). Will be deprecated since 19th Feb 2025. - **createdOn** (Timestamp) - The timestamp when the app was created. - **callbackUrl** (String) - The callback URL configured for the app. Will be deprecated since 19th Feb 2025. - **disableOptinPrefUrl** (Boolean) - Indicates if the opt-in preference URL is disabled. - **embedAllowed** (Boolean) - Indicates if embedding is allowed for the app. - **federated** (Boolean) - Indicates if the app is federated. - **id** (String) - The unique identifier of the app. - **languageCode** (String) - The language code associated with the app. - **live** (Boolean) - Indicates if the app is currently live. - **liveTs** (Timestamp) - The timestamp when the app was last set to live. - **modifiedOn** (Timestamp) - The timestamp when the app was last modified. - **name** (String) - The name of the app. - **phone** (String) - The phone number associated with the app. - **stopped** (Boolean) - Indicates if the app has been stopped. - **storageRegion** (String) - The storage region for the app's data (e.g., "US", "IN", "SG"). - **templateMessaging** (Boolean) - Indicates if template messaging is enabled for the app. - **type** (String) - The type of the app (e.g., "apicallbackpost"). - **version** (Integer) - The version of the app. - **app** (String) - Indicates if the response pertains to an app (e.g., "true"). #### Response Example ```json { "status": "success", "appDetails": { "billingType": "",////will be deprecated since 19th Feb 2025 "createdOn": , "callbackUrl": "", //will be deprecated since 19th Feb 2025 "disableOptinPrefUrl": true, "embedAllowed": false, "federated": false, "id": "", "languageCode": "", "live": true, "liveTs": , "modifiedOn": , "name": "", "phone": "phone", "stopped": false, "storageRegion": "", "templateMessaging": true, "type": "apicallbackpost", "version": 1 }, "app": "true" } ``` ``` -------------------------------- ### Sample Link App Response Source: https://partner-docs.gupshup.io/reference/post_partner-account-api-applink This is an example of a successful response when linking an application. It contains details about the partner's application, such as its creation date, health status, and unique identifiers. ```json { "partnerApps": { "createdOn": 1609829592910, "healthy": false, "id": "fa*b***e-d2**-****-be38-0****d*9a**b", "live": false, "modifiedOn": 1614162854108, "name": "assistant0092", "partnerId": 1, "phone": "91**********", "stopped": false, "walletId": "1**" } } ``` -------------------------------- ### Create Partner App Template with Flow Button Source: https://partner-docs.gupshup.io/reference/post_partner-app-appid-create-flow-8 Use this cURL command to send a POST request to create a new template for a partner application. This example includes a 'FLOW' type button with specific actions and an image media. ```curl curl --location 'https://partner.gupshup.io/partner/app/:appId/templates' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --header 'Authorization: {{PARTNER_APP_TOKEN}}' \ --data-urlencode 'elementName=test_flows_1' \ --data-urlencode 'languageCode=en' \ --data-urlencode 'content=Hi {{1}}, Today is the last day of the BIg Billion Day'\''s sale. Make the most out of it!' \ --data-urlencode 'category=MARKETING' \ --data-urlencode 'templateType=IMAGE' \ --data-urlencode 'example=Hi Sam, Today is the last day of the BIg Billion Day'\''s sale. Make the most out of it!' \ --data-urlencode 'enableSample=true' \ --data-urlencode 'allowTemplateCategoryChange=true' \ --data-urlencode 'vertical=Sample template using Flow button with others' \ --data-urlencode 'buttons= [ { "type": "FLOW", "text": "Share Interests", "flow_id": "3961313760791090", "flow_action": "NAVIGATE", "navigate_screen": "SEGMENTS_SCREEN", "icon": "PROMOTION" } ]' \ --data-urlencode 'exampleMedia=4::aW1hZ3UvanBlZw==:ARYNMS2RLy7ZxeZdLH6MlbuCHz2bm5naXIbAHYwsJjvrQLKCGZ9LPnNmBC4KYhH2j6WxJEHJ7L6u vxYsIYonRecvTCm_jyObpUJS-BRgFNcxOQ:e:1749806891:2281283925530161:61551923013914:ARbcT9jwPAS_B423dLM' ``` -------------------------------- ### OpenAPI Definition for Get Profile Photo Source: https://partner-docs.gupshup.io/reference/get_partner-app-appid-business-profile-photo This OpenAPI 3.0.3 definition outlines the GET endpoint for retrieving a business profile photo URL, including parameters and possible responses. ```json { "openapi": "3.0.3", "info": { "title": "Partner Portal Public APIs", "version": "1.0.0" }, "servers": [ { "url": "https://partner.gupshup.io" } ], "tags": [ { "name": "App" } ], "paths": { "/partner/app/{appId}/business/profile/photo": { "get": { "tags": [ "App" ], "summary": "APP | get profile photo url", "parameters": [ { "name": "Authorization", "in": "header", "schema": { "type": "string" }, "example": "{{PARTNER_APP_TOKEN}}" }, { "name": "appId", "in": "path", "schema": { "type": "string" }, "required": true, "example": "04e6c66b-bb95-4bfc-b75e-4e7391ddc680" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": {} } }, "400": { "description": "Bad request", "content": { "application/json": {} } }, "401": { "description": "Unauthorized", "content": { "application/json": {} } }, "500": { "description": "Internal server error", "content": { "application/json": {} } } } } } }, "x-readme": { "explorer-enabled": true, "proxy-enabled": true } } ```