URL

Use a URL in the following form to invoke the API.

POST https://api.appsheet.com/api/v2/apps/{appId}/tables/{tableName}/Action where

  • {appId} specifies the GUID of the AppSheet application.
  • {tableName} specifies the name of the table.

Application Access Key

You must include the API ApplicationAccessKey in every API call.

Application Access Key in HTTP Headers

It is best to specify the ApplicationAccessKey in the HTTP Headers because this is most secure. It is specified in the form:

ApplicationAccessKey=<applicationAccessKey>

For example:

ApplicationAccessKey=bA2SK-l5kzd-SdvFb-mqIe6-gBT8a-CXp3D-cjCYB-oiJ6U

Application Access Key in HTTP Query String

Alternatively, you can specify the ApplicationAccessKey in the HTTP Query String. This is less secure, but it may be necessary to do this if you cannot specify the HTTP Headers. It is specified in the form:

https://api.appsheet.com/api/v2/apps/{appId}/tables/{tableName}/Action?applicationAccessKey=<applicationAccessKey>

For example:

https://api.appsheet.com/api/v2/apps/{appId}/tables/{tableName}/Action?applicationAccessKey=bA2SK-l5kzd-SdvFb-mqIe6-gBT8a-CXp3D-cjCYB-oiJ6U

If the ApplicationAccessKey is specified in both the HTTP Headers and the HTTP Query String, the value in HTTP Headers is used.


Application Access Key Validation
When the API is invoked, the ApplicationAccessKey is compared to the Application Access Key and Alternate Application Access Key values on the API pane. The HTTP request is rejected and logged to Audit History if the ApplicationAccessKey you specify does not match one of these two values.

Application Access Key in AppSheet WebHook

When invoking the API from an AppSheet WebHook, you should specify the ApplicationAccessKey in the HTTP Header property and enclose the <applicationAccessKey> value in quotes. For example:

applicationAccessKey: "bA2SK-l5kzd-SdvFb-mqIe6-gBT8a-CXp3D-cjCYB-oiJ6U"


HTTP Body

The API HTTP Body specifies:

Actions

The name of the Action to perform. Select one of the following values:

  1. Add: Adds new table records.
  2. Delete: Deletes existing table records.
  3. Edit: Updates existing table records.
  4. Find: Reads an existing record.
  5. Action Name: Invokes a Data Change action you have defined as an AppSheet Action.

Properties

The properties of the API request in JSON format. These properties are optional.

  • Locale
    The Locale of the client making the request. For example “en-US” represents English, United States. If this value is not specified, Locale defaults to “en-US”.

    The Locale is used when validating Date, Time, DateTime, Decimal, Percent, and Price data values. For example, when Locale is "en-US", date values must be entered in MM/DD/YYYY format. When Locale is "en-GB", date values must be entered in DD/MM/YYYY format.
  • Location
    The latitude and longitude of the client making the request.

    This value is used for ChangeLocation fields. For example "47.623098, -122.330184" represents Seattle, Washington. If this value is not specified, the Location defaults to  "0.000000. 0.000000".
  • Timezone
    The timezone of the client making the request. For example "Pacific Standard Time" represents Pacific Standard Time in the United States and Canada. If this value is not specified, the Timezone defaults to "UTC".
  • RunAsUserEmail
    The user email address of the person taking the action. The action is performed under the user id of the user email address you specify. If this value is not specified, the action is performed under the user id of the application owner.

Rows

The table’s field names and field values in JSON format.

  • You must specify field names and field value for all key fields for Actions "Delete", "Edit", "Find", and "Action". Special rules apply for key fields for Action "Add" as described here.
  • You must specify field names and field value for all Required fields for Action “Add”.
  • You may specify field names and field value for non-Required fields for Action "Add". Non-Required fields that are not specified will be assigned the Default value, if any.
  • You may specify field names and field value for non-Required fields for Action "Edit". Non-Required fields that are not specified will remain unchanged.
  • All field values must match their data types in the table schema.

API Response HTTP Status Codes

The API returns the following HTTP status codes. 

  1. 200 Success
  2. 400 Bad Request
    a. The Application Access Key is missing.
    b. The AppId is missing.
    c. The Post body contains invalid data.
  3. 403 Forbidden
    a. The Web API is not enabled for this application.
    b. The Application Access Key is invalid.
  4. 404 Not Found
    a. The application specified by the AppId cannot be found.
  5. 500 Internal Server Error
    a. An unexpected error occurred.

Did this answer your question?