Migration to REST API v3
5 minutes to readAs previously announced, REST API v1 and v2 are pending deprecation. We highly recommend migrating to version 3 to experience new features, including the new Swagger UI with OpenAPI Specification version 3.0, new operations, and new endpoints.
Migration from REST API v2 to v3
To migrate your application from REST API v2 to v3, you need to update base URL for REST API endpoints in your application from:
https://<your-integration-URL>.caspio.com/rest/v2
to:
https://<your-integration-URL>.caspio.com/integrations/rest/v3
Example: update https://c0abc123.caspio.com/rest/v2/tables
to: https://c0abc123.caspio.com/integrations/rest/v3/tables.
In addition to that, use the following renamed endpoints:
- Bridge applications: instead of /v2/applications/
in v3, use:
/v3/bridgeApplications/ - Data import/export tasks: instead of /v2/tasks/
in v3, use:
/v3/dataImportExportTasks
Changes introduced in REST API v3 are listed below.
General changes
Error handling enhancements
Error handling was improved. HTTP codes, error codes, and messages were updated.
Updated operationId values
The operationId values for REST API endpoints in the Swagger UI (OpenAPI) documentation were revised for clarity and consistency.
If you use tools or code generators (such as Swagger Codegen, OpenAPI Generator, or NSwag) to create client code, SDKs, or documentation, note that the generated method names in v3 will differ due to updated operationId values.
New operation types
Directories operations
Directories operations were introduced with capabilities for:
- Returning the list of directories
- Creating, updating, and deleting users
- Returning a list of users
- Activating users using POST operations
Views operations
For views operations, new GET endpoints return the list of fields included in the view and their properties.
Operations updates
Table operations
In table operations used for updating table design:
- The PUT request schema was changed to match the POST request schema.
The word New was removed from the names of properties. - Attachment-related properties were added to GET, POST, and PUT operations.
- A new Editable property was added to GET operations. This property indicates whether a field can be updated through API operations.
- Editable = true for:
Text (255), Text (64000), Number, Integer, Currency, Date/Time, Yes/No, File, Attachment, List-String, List-Number, List-Date, Password. - Editable = false for:
Timestamp, Random ID, Autonumber, Prefixed Autonumber, GUID, Formula.
- Editable = true for:
In table records operations:
- You can update List data type fields using either list item IDs or the actual list values. The following formats are accepted in POST and PUT operations:
- IDs:
- JSON arrays: [1, 2]
- Comma-separated strings: “1,2”
- Stringified arrays: “[1,2]”
- Values:
- JSON arrays: [“A”, “B”]
- Comma-separated strings with escaped quotes: “\”A\”,\”B\””
- Stringified arrays: “[\”A\”,\”B\”]”
All values must be passed as strings. List-String comparisons are case-insensitive and must match defined list values. List-Number comparisons are numeric; comparison is based on value, not string format. List-Date comparisons use date/time equivalence. Supported formats include standard US date formats and sortable formats such as:
- yyyy-MM-dd hh:mm:ss
- yyyy-MM-ddThh:mm:ss
All list values must form a valid JSON array, even when wrapped inside a string literal.
- IDs:
- You can include optional pagination information in responses returned by GET operation. Enable this by specifying the query parameter:
q.getPaginationInfo=true|false
Pagination information is returned only when:- q.getPaginationInfo=true, and
- a valid q.pageNumber or q.pageSize is supplied.
When enabled, responses include a Pagination object.
View operations
Because views are built on tables, the changes described above for table operations apply to views operations as well, with the following exception.
Editable property for views fields is true only when:
- The underlying table field is editable, and
- The view allows editing that table.
Also, password fields are never editable in views, because views do not have special operations for updating password fields.
Files operations
- File and folder operations were separated.
GET /v3/files returns files only, while GET /v3/files/folders returns folders. - Both files and folders operations support additional pagination and sorting options.
Bridge applications operations
Deploying and undeploying DataPages is now handled using a single PUT operation with a parameter.
In v2, both PUT and DELETE operations were required.
Outgoing webhooks operations
Updating webhook status using PUT operations was simplified.
Only one Enable property is now required to change the webhook status and its events.
A full list of REST API v3 operations is available on Swagger UI.
Migration from REST API v1 to v3
If you use REST API v1, alongside all the changes required by v3 that are described above, perform the following revisions that we recommended for migration from v1:
DataPage endpoints changes:
DataPage endpoints have been grouped together with Application endpoints under v3/bridgeApplications/{externalKey}/datapages(…)
Table and View endpoints changes:
rows changed to records (for example, rest/v1/tables/{tableName}/rows is now rest/v3/tables/{tableName}/records)
columns changed to fields
JSON encoded query string parameters (q) changed to individual query string parameters:
In REST API v1
q={“select”:”fields list”,”where”:”WHERE condition”,”groupby”:”grouping fields list”,”orderby”:”ordering fields list”,”limit”:<rows count>,”pageNumber”:<page number>,”pageSize”:<rows per page>}
In REST API v3
q.select=<fields list>&q.where=<WHERE condition>&q.groupBy=<grouping fields list>&q.orderBy=<ordering fields list>&q.limit=<rows count>&q.pageNumber=<page number>&q.pageSize=<rows per page>