Update Record

API endpoint that will update an existing record.

Note: This API documentation is intended to give the reader an overview of the APIs capabilities and how to access them. When trying to write API calls, we strongly recommend you use the API documentation directly associated with the specific API key you will be calling. That documentation includes examples with the actual IDs of the form and form elements, includes examples for each field available in the associated forms etc. This will allow direct copy-paste of the code snippets from the documentation into your code. If you were to try and use the examples in this documentation, you would have to modify them for the fields, form ID, etc.

HTTP request

PUT https://api.gwapps.com/v1/forms/formId/records/recordId

Parameters

ParameterDescriptionType
Required path parameters
formIdThe current formId 66b18359dc7659dc4cb98d15string
recordIdThe recordIdstring

Request Body

ParameterDescriptionType
Required parameters
stageThe stage that the record will have, this stage must exist under the workflow stages defined in the formstring | object
Field Short Code*Each field in the form has a unique shortCode. You can find the Field Short Codes in form “Overview” section. You can also update your field Short Codes from the Field Properties in Form Designer.* Depends on the field type. Refer to form “Overview”.

Example Request

PUT https://api.gwapps.com/v1/forms/66b18359dc7659dc4cb98d15/records/recordId
{
  "stage": "stg0",
  "text1": "John",
  "number1": 10,
  "currency1": {
    "code": "USD",
    "value": 120
  }
}

start

Note: If you pass a field that does not exist in the current form you will get a Bad Request error response, same applies for stages that does not exist in the form. You can take a look in the Overview section to review the available fields and stages for this form.
Only short codes passed in the request will be updated. If you want to clear a field, you need to explicitly pass the field short code with a null value.

Stage Value

start

Note: The record stage could also be passed as an object.

{
  "stage": {
    "id": "stg0",
    "status": "Draft"
  }
}

start

Note: If a field short code is not specified at update time, it is left unchanged. To delete a field value from a record, you must set it to null explicitly.

  {
      "field1": null // deletes field1 from this record
  }

Response

The response returned will have the record information, where

AttributeDescriptionType
_idThe record IDstring
stageThe record’s stageStage
shortCodeDepends on field typeEach value is different depending on the field type

Example Response

{
  "kind": "form#record",
  "_id": "recordId",
  "meta": {
    "appId": "6266db8cbd86d9001a70c9ea",
    "formId": "66b18359dc7659dc4cb98d15"
  },
  "stage": {
    "id": "stg0",
    "status": "Draft"
  },
  "text1": "John",
  "number1": 10,
  "currency1": {
    "code": "USD",
    "value": 120
  }
}

This article covers details for a specific API call/endpoint. Details of the overall Records API structure and calls/endpoints can be found in the GW Apps Records API article. Information on creating API Keys can be found within the API section of the Platform Settings, and in the Security > API Keys section of Edit App within each application.

Updated on August 27, 2024
Was this article helpful?

Related Articles