API_EditRecord

Don't forget to check out our JSON RESTful APIs, they can help you utilize and extend Quickbase with ease.

 

Overview

Use API_EditRecord to change any editable field values in the specified record. Only those fields specified are changed; unspecified fields are left unchanged.

You can specify either field names or field IDs when using this call.

top

Request parameters

The following request parameters are available:

ParameterValueRequired?

rid or key

The record ID of the record to be edited. You can obtain the recordID of any record in a query. (See API_DoQuery).

If you use a key field OTHER than the record id (rid), you should use the key parameter rather than rid.

yes

update_id

Specifies the latest record state.

Note that, if another user makes changes before you issue this call,  the update ID in Quickbase will change, which will render invalid the update ID that you have. In this case, you should get the latest version of the record and its new update ID, and then make your changes.

You can obtain the update ID for a record using the API_GetRecordInfo for the record you are editing.

no

field

Specify values for the fields that make up the record you want to add using either the fid attribute or name attribute of the <field> element.

For example:

<field fid=”18”>Hi!</field>
<field name=”Message”>Hi!</field>

You must specify all required fields.

The values you enter here will vary, depending on field type. See How to specify values for different field types for more information.

yes

disprec

Set this parameter to 1 to specify that the new record should be displayed within the Quickbase application. An application login is required before the record can be displayed. If you use this parameter, Quickbase returns the normal Quickbase HTML page that displays the record.

Omit this property if you don't want the new record to display within the Quickbase application.

no

fform

Set this parameter to 1 if you are invoking API_EditRecord from within an HTML form that has checkboxes and want those checkboxes to set Quickbase checkbox fields.

Omit this property if you don't need Quickbase to set Checkbox fields based on your HTML page.

no

ignoreError

Set this parameter to 1 to specify that no error should be returned when a built-in field (for example, Record ID#) is written-to in an API_EditRecord call.

If you do not set this parameter, Quickbase returns an error when API_EditRecord writes to a built-in field.

 

ticket

Specifies valid authentication ticket. You obtain a valid ticket from API_Authenticate. A ticket is also returned in the various API responses. See API Overview for more information on the authentication ticket.

yes, one of:

  • ticket
  • username/password
  • user token

usertoken

The user token is an alternative means of authentication, used for API access. User tokens cannot be used to access the Quickbase UI.

yes, one of:

  • ticket
  • username/password
  • user token

apptoken

Specifies a valid application token. See API Overview for more information on application tokens.

yes, if the application requires application tokens

udata

A string value that you want returned. It will not be handled by Quickbase but it will be returned in the response.

no

msInUTC

Allows you to specify that Quickbase should interpret all date/time stamps passed in as milliseconds using Coordinated Universal Time (UTC) rather than using the local application time.

Set this parameter to 1 if you want to use Coordinated Universal Time. See usage example.

no

clist

A period-delimited list of field IDs to be returned. Quickbase will return values for these field IDs in the order in which you enter them here.

To return all fields in a table, set this parameter to the value a.

Allows you to return the state of dynamic fields like formulas, lookups or summaries without combining with API_DoQuery.

no

top

Response values

The response to this call contains the following:

Element NameValue

action

Echoes the originating request, for example, API_AddField.

errcode

Identifies the error code, if any. (See the Error Codes appendix for a list of possible error codes.)

0 indicates that no error was encountered.

errtext

Text that explains the error code.

"No error" indicates that no error was encountered.

udata

Optional. Contains any udata value supplied in the request.

rid

Record ID of the record that was edited

num_fields_changed

The number of record fields successfully updated in the edit.

update_id

This parameter is used to detect update conflicts when invoking API_EditRecord.

You could save this update ID when you add a new record, but it would be better to instead get the most recent update_id value later when you query for the record to get it and update it.

top

Sample XML Request

POST https://target_domain/db/target_dbid HTTP/1.0
Content-Type: application/xml
Content-Length:
QUICKBASE-ACTION: API_EditRecord

Using Field Names

<qdbapi>
  <udata>mydata</udata>
   <ticket>auth_ticket</ticket>
   <apptoken>app_token</apptoken>
     <rid>4</rid>
  <field name="start_date">06-08-2008</field>
   <field name="attendee_name">Joseph Riesentrotter</field>
</qdbapi>

Using Field IDs

<qdbapi>
<udata>mydata</udata>
   <ticket>auth_ticket</ticket>
   <apptoken>app_token</apptoken>
     <rid>4</rid>
  <field fid="11">06-08-2008</field>
  <field fid="12">Joseph Riesentrotter</field>
</qdbapi>

top

URL alternative

https://target_domain/db/target_dbid?a=API_EditRecord&rid=154
&_fnm_second_year=1776&_fid_8=changed&update_id=992017018414
&ticket=auth_ticket&apptoken=app_token

where target_domain is the domain against which you are invoking this call, for example, quickbase.com. Read about this notation.

top

Sample response

<?xml version="1.0" ?>
<qdbapi>
   <action>API_EditRecord</action>
   <errcode>0</errcode>
   <errtext>No error</errtext>
   <ticket>2_bddqkpam2_dpsx_b_dhfjng8kqhysrb2vbisibpzjqz7</ticket>
   <rid>17</rid>
   <num_fields_changed>2</num_fields_changed>
   <update_id>1205700275470</update_id>
</qdbapi>