# Create API App POST https://api.hellosign.com/v3/api_app Content-Type: application/json Creates a new API App. Reference: https://developer.hellosign.com/api/api-app/create ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Create API App version: endpoint_apiApp.create paths: /api_app: post: operationId: create summary: Create API App description: Creates a new API App. tags: - - subpackage_apiApp parameters: - name: Authorization in: header description: Basic authentication of the form `Basic `. required: true schema: type: string responses: '201': description: successful operation content: application/json: schema: $ref: '#/components/schemas/ApiAppGetResponse' '400': description: failed_operation content: {} requestBody: content: application/json: schema: $ref: '#/components/schemas/ApiAppCreateRequest' components: schemas: SubOAuthScopesItems: type: string enum: - value: request_signature - value: basic_account_info - value: account_access - value: signature_request_access - value: template_access - value: team_access - value: api_app_access - value: '' SubOAuth: type: object properties: callback_url: type: string description: >- The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided) scopes: type: array items: $ref: '#/components/schemas/SubOAuthScopesItems' description: >- A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided). SubOptions: type: object properties: can_insert_everywhere: type: boolean default: false description: >- Determines if signers can use "Insert Everywhere" when signing a document. SubWhiteLabelingOptionsLegalVersion: type: string enum: - value: terms1 - value: terms2 default: terms1 SubWhiteLabelingOptions: type: object properties: header_background_color: type: string default: '#1a1a1a' legal_version: $ref: '#/components/schemas/SubWhiteLabelingOptionsLegalVersion' link_color: type: string default: '#0061FE' page_background_color: type: string default: '#f7f8f9' primary_button_color: type: string default: '#0061FE' primary_button_color_hover: type: string default: '#0061FE' primary_button_text_color: type: string default: '#ffffff' primary_button_text_color_hover: type: string default: '#ffffff' secondary_button_color: type: string default: '#ffffff' secondary_button_color_hover: type: string default: '#ffffff' secondary_button_text_color: type: string default: '#0061FE' secondary_button_text_color_hover: type: string default: '#0061FE' text_color1: type: string default: '#808080' text_color2: type: string default: '#ffffff' reset_to_default: type: boolean description: >- Resets white labeling options to defaults. Only useful when updating an API App. ApiAppCreateRequest: type: object properties: callback_url: type: string description: The URL at which the ApiApp should receive event callbacks. custom_logo_file: type: string format: binary description: >- An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) domains: type: array items: type: string description: The domain names the ApiApp will be associated with. name: type: string description: The name you want to assign to the ApiApp. oauth: $ref: '#/components/schemas/SubOAuth' options: $ref: '#/components/schemas/SubOptions' white_labeling_options: $ref: '#/components/schemas/SubWhiteLabelingOptions' required: - domains - name ApiAppResponseOAuth: type: object properties: callback_url: type: string description: The app's OAuth callback URL. secret: type: - string - 'null' description: The app's OAuth secret, or null if the app does not belong to user. scopes: type: array items: type: string description: Array of OAuth scopes used by the app. charges_users: type: boolean description: >- Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests. ApiAppResponseOptions: type: object properties: can_insert_everywhere: type: boolean description: >- Boolean denoting if signers can "Insert Everywhere" in one click while signing a document ApiAppResponseOwnerAccount: type: object properties: account_id: type: string description: The owner account's ID email_address: type: string description: The owner account's email address ApiAppResponseWhiteLabelingOptions: type: object properties: header_background_color: type: string legal_version: type: string link_color: type: string page_background_color: type: string primary_button_color: type: string primary_button_color_hover: type: string primary_button_text_color: type: string primary_button_text_color_hover: type: string secondary_button_color: type: string secondary_button_color_hover: type: string secondary_button_text_color: type: string secondary_button_text_color_hover: type: string text_color1: type: string text_color2: type: string ApiAppResponse: type: object properties: callback_url: type: - string - 'null' description: The app's callback URL (for events) client_id: type: string description: The app's client id created_at: type: integer description: The time that the app was created domains: type: array items: type: string description: The domain name(s) associated with the app name: type: string description: The name of the app is_approved: type: boolean description: Boolean to indicate if the app has been approved oauth: $ref: '#/components/schemas/ApiAppResponseOAuth' options: $ref: '#/components/schemas/ApiAppResponseOptions' owner_account: $ref: '#/components/schemas/ApiAppResponseOwnerAccount' white_labeling_options: $ref: '#/components/schemas/ApiAppResponseWhiteLabelingOptions' WarningResponse: type: object properties: warning_msg: type: string description: Warning message warning_name: type: string description: Warning name required: - warning_msg - warning_name ApiAppGetResponse: type: object properties: api_app: $ref: '#/components/schemas/ApiAppResponse' warnings: type: array items: $ref: '#/components/schemas/WarningResponse' description: A list of warnings. required: - api_app ``` ## SDK Code Examples ```php PHP setUsername("YOUR_API_KEY"); // $config->setAccessToken("YOUR_ACCESS_TOKEN"); $oauth = (new Dropbox\Sign\Model\SubOAuth()) ->setCallbackUrl("https://example.com/oauth") ->setScopes([ Dropbox\Sign\Model\SubOAuth::SCOPES_BASIC_ACCOUNT_INFO, Dropbox\Sign\Model\SubOAuth::SCOPES_REQUEST_SIGNATURE, ]); $white_labeling_options = (new Dropbox\Sign\Model\SubWhiteLabelingOptions()) ->setPrimaryButtonColor("#00b3e6") ->setPrimaryButtonTextColor("#ffffff"); $api_app_create_request = (new Dropbox\Sign\Model\ApiAppCreateRequest()) ->setName("My Production App") ->setDomains([ "example.com", ]) ->setCustomLogoFile(new SplFileObject("CustomLogoFile.png")) ->setOauth($oauth) ->setWhiteLabelingOptions($white_labeling_options); try { $response = (new Dropbox\Sign\Api\ApiAppApi(config: $config))->apiAppCreate( api_app_create_request: $api_app_create_request, ); print_r($response); } catch (Dropbox\Sign\ApiException $e) { echo "Exception when calling ApiAppApi#apiAppCreate: {$e->getMessage()}"; } ``` ```csharp C# using System; using System.Collections.Generic; using System.IO; using System.Text.Json; using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; namespace Dropbox.SignSandbox; public class ApiAppCreateExample { public static void Run() { var config = new Configuration(); config.Username = "YOUR_API_KEY"; // config.AccessToken = "YOUR_ACCESS_TOKEN"; var oauth = new SubOAuth( callbackUrl: "https://example.com/oauth", scopes: [ SubOAuth.ScopesEnum.BasicAccountInfo, SubOAuth.ScopesEnum.RequestSignature, ] ); var whiteLabelingOptions = new SubWhiteLabelingOptions( primaryButtonColor: "#00b3e6", primaryButtonTextColor: "#ffffff" ); var apiAppCreateRequest = new ApiAppCreateRequest( name: "My Production App", domains: [ "example.com", ], customLogoFile: new FileStream( path: "CustomLogoFile.png", mode: FileMode.Open ), oauth: oauth, whiteLabelingOptions: whiteLabelingOptions ); try { var response = new ApiAppApi(config).ApiAppCreate( apiAppCreateRequest: apiAppCreateRequest ); Console.WriteLine(response); } catch (ApiException e) { Console.WriteLine("Exception when calling ApiAppApi#ApiAppCreate: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } } } ``` ```typescript TypeScript import * as fs from 'fs'; import api from "@dropbox/sign" import models from "@dropbox/sign" const apiCaller = new api.ApiAppApi(); apiCaller.username = "YOUR_API_KEY"; // apiCaller.accessToken = "YOUR_ACCESS_TOKEN"; const oauth: models.SubOAuth = { callbackUrl: "https://example.com/oauth", scopes: [ models.SubOAuth.ScopesEnum.BasicAccountInfo, models.SubOAuth.ScopesEnum.RequestSignature, ], }; const whiteLabelingOptions: models.SubWhiteLabelingOptions = { primaryButtonColor: "#00b3e6", primaryButtonTextColor: "#ffffff", }; const apiAppCreateRequest: models.ApiAppCreateRequest = { name: "My Production App", domains: [ "example.com", ], customLogoFile: fs.createReadStream("CustomLogoFile.png"), oauth: oauth, whiteLabelingOptions: whiteLabelingOptions, }; apiCaller.apiAppCreate( apiAppCreateRequest, ).then(response => { console.log(response.body); }).catch(error => { console.log("Exception when calling ApiAppApi#apiAppCreate:"); console.log(error.body); }); ``` ```java Java package com.dropbox.sign_sandbox; import com.dropbox.sign.ApiException; import com.dropbox.sign.Configuration; import com.dropbox.sign.api.*; import com.dropbox.sign.auth.*; import com.dropbox.sign.JSON; import com.dropbox.sign.model.*; import java.io.File; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; import java.util.Map; public class ApiAppCreateExample { public static void main(String[] args) { var config = Configuration.getDefaultApiClient(); ((HttpBasicAuth) config.getAuthentication("api_key")).setUsername("YOUR_API_KEY"); // ((HttpBearerAuth) config.getAuthentication("oauth2")).setBearerToken("YOUR_ACCESS_TOKEN"); var oauth = new SubOAuth(); oauth.callbackUrl("https://example.com/oauth"); oauth.scopes(List.of ( SubOAuth.ScopesEnum.BASIC_ACCOUNT_INFO, SubOAuth.ScopesEnum.REQUEST_SIGNATURE )); var whiteLabelingOptions = new SubWhiteLabelingOptions(); whiteLabelingOptions.primaryButtonColor("#00b3e6"); whiteLabelingOptions.primaryButtonTextColor("#ffffff"); var apiAppCreateRequest = new ApiAppCreateRequest(); apiAppCreateRequest.name("My Production App"); apiAppCreateRequest.domains(List.of ( "example.com" )); apiAppCreateRequest.customLogoFile(new File("CustomLogoFile.png")); apiAppCreateRequest.oauth(oauth); apiAppCreateRequest.whiteLabelingOptions(whiteLabelingOptions); try { var response = new ApiAppApi(config).apiAppCreate( apiAppCreateRequest ); System.out.println(response); } catch (ApiException e) { System.err.println("Exception when calling ApiAppApi#apiAppCreate"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } } } ``` ```ruby Ruby require "json" require "dropbox-sign" Dropbox::Sign.configure do |config| config.username = "YOUR_API_KEY" # config.access_token = "YOUR_ACCESS_TOKEN" end oauth = Dropbox::Sign::SubOAuth.new oauth.callback_url = "https://example.com/oauth" oauth.scopes = [ "basic_account_info", "request_signature", ] white_labeling_options = Dropbox::Sign::SubWhiteLabelingOptions.new white_labeling_options.primary_button_color = "#00b3e6" white_labeling_options.primary_button_text_color = "#ffffff" api_app_create_request = Dropbox::Sign::ApiAppCreateRequest.new api_app_create_request.name = "My Production App" api_app_create_request.domains = [ "example.com", ] api_app_create_request.custom_logo_file = File.new("CustomLogoFile.png", "r") api_app_create_request.oauth = oauth api_app_create_request.white_labeling_options = white_labeling_options begin response = Dropbox::Sign::ApiAppApi.new.api_app_create( api_app_create_request, ) p response rescue Dropbox::Sign::ApiError => e puts "Exception when calling ApiAppApi#api_app_create: #{e}" end ``` ```python Python import json from datetime import date, datetime from pprint import pprint from dropbox_sign import ApiClient, ApiException, Configuration, api, models configuration = Configuration( username="YOUR_API_KEY", # access_token="YOUR_ACCESS_TOKEN", ) with ApiClient(configuration) as api_client: oauth = models.SubOAuth( callback_url="https://example.com/oauth", scopes=[ "basic_account_info", "request_signature", ], ) white_labeling_options = models.SubWhiteLabelingOptions( primary_button_color="#00b3e6", primary_button_text_color="#ffffff", ) api_app_create_request = models.ApiAppCreateRequest( name="My Production App", domains=[ "example.com", ], custom_logo_file=open("CustomLogoFile.png", "rb").read(), oauth=oauth, white_labeling_options=white_labeling_options, ) try: response = api.ApiAppApi(api_client).api_app_create( api_app_create_request=api_app_create_request, ) pprint(response) except ApiException as e: print("Exception when calling ApiAppApi#api_app_create: %s\n" % e) ``` ```go API App package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.hellosign.com/v3/api_app" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("Authorization", "Basic :") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```swift API App import Foundation let headers = [ "Authorization": "Basic :", "Content-Type": "application/json" ] let request = NSMutableURLRequest(url: NSURL(string: "https://api.hellosign.com/v3/api_app")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ```php PHP setUsername("YOUR_API_KEY"); // $config->setAccessToken("YOUR_ACCESS_TOKEN"); $oauth = (new Dropbox\Sign\Model\SubOAuth()) ->setCallbackUrl("https://example.com/oauth") ->setScopes([ Dropbox\Sign\Model\SubOAuth::SCOPES_BASIC_ACCOUNT_INFO, Dropbox\Sign\Model\SubOAuth::SCOPES_REQUEST_SIGNATURE, ]); $white_labeling_options = (new Dropbox\Sign\Model\SubWhiteLabelingOptions()) ->setPrimaryButtonColor("#00b3e6") ->setPrimaryButtonTextColor("#ffffff"); $api_app_create_request = (new Dropbox\Sign\Model\ApiAppCreateRequest()) ->setName("My Production App") ->setDomains([ "example.com", ]) ->setCustomLogoFile(new SplFileObject("CustomLogoFile.png")) ->setOauth($oauth) ->setWhiteLabelingOptions($white_labeling_options); try { $response = (new Dropbox\Sign\Api\ApiAppApi(config: $config))->apiAppCreate( api_app_create_request: $api_app_create_request, ); print_r($response); } catch (Dropbox\Sign\ApiException $e) { echo "Exception when calling ApiAppApi#apiAppCreate: {$e->getMessage()}"; } ``` ```csharp C# using System; using System.Collections.Generic; using System.IO; using System.Text.Json; using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; namespace Dropbox.SignSandbox; public class ApiAppCreateExample { public static void Run() { var config = new Configuration(); config.Username = "YOUR_API_KEY"; // config.AccessToken = "YOUR_ACCESS_TOKEN"; var oauth = new SubOAuth( callbackUrl: "https://example.com/oauth", scopes: [ SubOAuth.ScopesEnum.BasicAccountInfo, SubOAuth.ScopesEnum.RequestSignature, ] ); var whiteLabelingOptions = new SubWhiteLabelingOptions( primaryButtonColor: "#00b3e6", primaryButtonTextColor: "#ffffff" ); var apiAppCreateRequest = new ApiAppCreateRequest( name: "My Production App", domains: [ "example.com", ], customLogoFile: new FileStream( path: "CustomLogoFile.png", mode: FileMode.Open ), oauth: oauth, whiteLabelingOptions: whiteLabelingOptions ); try { var response = new ApiAppApi(config).ApiAppCreate( apiAppCreateRequest: apiAppCreateRequest ); Console.WriteLine(response); } catch (ApiException e) { Console.WriteLine("Exception when calling ApiAppApi#ApiAppCreate: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } } } ``` ```typescript TypeScript import * as fs from 'fs'; import api from "@dropbox/sign" import models from "@dropbox/sign" const apiCaller = new api.ApiAppApi(); apiCaller.username = "YOUR_API_KEY"; // apiCaller.accessToken = "YOUR_ACCESS_TOKEN"; const oauth: models.SubOAuth = { callbackUrl: "https://example.com/oauth", scopes: [ models.SubOAuth.ScopesEnum.BasicAccountInfo, models.SubOAuth.ScopesEnum.RequestSignature, ], }; const whiteLabelingOptions: models.SubWhiteLabelingOptions = { primaryButtonColor: "#00b3e6", primaryButtonTextColor: "#ffffff", }; const apiAppCreateRequest: models.ApiAppCreateRequest = { name: "My Production App", domains: [ "example.com", ], customLogoFile: fs.createReadStream("CustomLogoFile.png"), oauth: oauth, whiteLabelingOptions: whiteLabelingOptions, }; apiCaller.apiAppCreate( apiAppCreateRequest, ).then(response => { console.log(response.body); }).catch(error => { console.log("Exception when calling ApiAppApi#apiAppCreate:"); console.log(error.body); }); ``` ```java Java package com.dropbox.sign_sandbox; import com.dropbox.sign.ApiException; import com.dropbox.sign.Configuration; import com.dropbox.sign.api.*; import com.dropbox.sign.auth.*; import com.dropbox.sign.JSON; import com.dropbox.sign.model.*; import java.io.File; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; import java.util.Map; public class ApiAppCreateExample { public static void main(String[] args) { var config = Configuration.getDefaultApiClient(); ((HttpBasicAuth) config.getAuthentication("api_key")).setUsername("YOUR_API_KEY"); // ((HttpBearerAuth) config.getAuthentication("oauth2")).setBearerToken("YOUR_ACCESS_TOKEN"); var oauth = new SubOAuth(); oauth.callbackUrl("https://example.com/oauth"); oauth.scopes(List.of ( SubOAuth.ScopesEnum.BASIC_ACCOUNT_INFO, SubOAuth.ScopesEnum.REQUEST_SIGNATURE )); var whiteLabelingOptions = new SubWhiteLabelingOptions(); whiteLabelingOptions.primaryButtonColor("#00b3e6"); whiteLabelingOptions.primaryButtonTextColor("#ffffff"); var apiAppCreateRequest = new ApiAppCreateRequest(); apiAppCreateRequest.name("My Production App"); apiAppCreateRequest.domains(List.of ( "example.com" )); apiAppCreateRequest.customLogoFile(new File("CustomLogoFile.png")); apiAppCreateRequest.oauth(oauth); apiAppCreateRequest.whiteLabelingOptions(whiteLabelingOptions); try { var response = new ApiAppApi(config).apiAppCreate( apiAppCreateRequest ); System.out.println(response); } catch (ApiException e) { System.err.println("Exception when calling ApiAppApi#apiAppCreate"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } } } ``` ```ruby Ruby require "json" require "dropbox-sign" Dropbox::Sign.configure do |config| config.username = "YOUR_API_KEY" # config.access_token = "YOUR_ACCESS_TOKEN" end oauth = Dropbox::Sign::SubOAuth.new oauth.callback_url = "https://example.com/oauth" oauth.scopes = [ "basic_account_info", "request_signature", ] white_labeling_options = Dropbox::Sign::SubWhiteLabelingOptions.new white_labeling_options.primary_button_color = "#00b3e6" white_labeling_options.primary_button_text_color = "#ffffff" api_app_create_request = Dropbox::Sign::ApiAppCreateRequest.new api_app_create_request.name = "My Production App" api_app_create_request.domains = [ "example.com", ] api_app_create_request.custom_logo_file = File.new("CustomLogoFile.png", "r") api_app_create_request.oauth = oauth api_app_create_request.white_labeling_options = white_labeling_options begin response = Dropbox::Sign::ApiAppApi.new.api_app_create( api_app_create_request, ) p response rescue Dropbox::Sign::ApiError => e puts "Exception when calling ApiAppApi#api_app_create: #{e}" end ``` ```python Python import json from datetime import date, datetime from pprint import pprint from dropbox_sign import ApiClient, ApiException, Configuration, api, models configuration = Configuration( username="YOUR_API_KEY", # access_token="YOUR_ACCESS_TOKEN", ) with ApiClient(configuration) as api_client: oauth = models.SubOAuth( callback_url="https://example.com/oauth", scopes=[ "basic_account_info", "request_signature", ], ) white_labeling_options = models.SubWhiteLabelingOptions( primary_button_color="#00b3e6", primary_button_text_color="#ffffff", ) api_app_create_request = models.ApiAppCreateRequest( name="My Production App", domains=[ "example.com", ], custom_logo_file=open("CustomLogoFile.png", "rb").read(), oauth=oauth, white_labeling_options=white_labeling_options, ) try: response = api.ApiAppApi(api_client).api_app_create( api_app_create_request=api_app_create_request, ) pprint(response) except ApiException as e: print("Exception when calling ApiAppApi#api_app_create: %s\n" % e) ``` ```go Default Example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.hellosign.com/v3/api_app" payload := strings.NewReader("{\n \"domains\": [\n \"example.com\"\n ],\n \"name\": \"My Production App\",\n \"custom_logo_file\": \"CustomLogoFile.png\",\n \"oauth\": {\n \"callback_url\": \"https://example.com/oauth\",\n \"scopes\": [\n \"basic_account_info\",\n \"request_signature\"\n ]\n },\n \"white_labeling_options\": {\n \"primary_button_color\": \"#00b3e6\",\n \"primary_button_text_color\": \"#ffffff\"\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Basic :") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```swift Default Example import Foundation let headers = [ "Authorization": "Basic :", "Content-Type": "application/json" ] let parameters = [ "domains": ["example.com"], "name": "My Production App", "custom_logo_file": "CustomLogoFile.png", "oauth": [ "callback_url": "https://example.com/oauth", "scopes": ["basic_account_info", "request_signature"] ], "white_labeling_options": [ "primary_button_color": "#00b3e6", "primary_button_text_color": "#ffffff" ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.hellosign.com/v3/api_app")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```