Update a Contact

PUT /contacts/{id} — Use this method to update the contact record with the specified internal ID.

Parameters

Path parameters

Path parameter

Required / Optional

Description

Type

{id}

Required

The internal ID of the contact.

integer

Query string parameter

Path parameter

Required / Optional

Description

Type

fields

Optional

A comma-separated list of attributes to include in the response. If not specified, the response includes all attributes for the contact returned.

string

filterSetId

Optional

The internal ID of the filter set to be applied.

  • When specified, the request is successful only if the action is available when the specified filter set is active in OpenAir. The filter set with the specified internal ID must exist and must be associated with the user who authorized the application as per the access token.

  • Otherwise and by default, the primary filter set associated with the user who authorized the application is applied.

integer

return_object

Optional

If set to any value other than 0 (zero), the response will include the contact updated. Otherwise, the response will include only the internal ID of the contact updated.

Boolean

Request body

An object including valid key-value pairs for the fields to be updated. The object cannot include key-value pairs for read-only attributes. For information about the Contact object model, see Contact object properties.

Response definitions

A successful request returns a JSON object with the following properties:

Property

Description

data

An array containing one of the following:

  • The Contact object updated, if the return_object parameter was set to any value other than 0 (zero) in the request. The object includes all the attributes specified using the fields if included in the request.

  • An object with only the ID of the contact updated.

See Returned Data.

message

A string containing a brief message about the status of your request — e.g. “Success”.

A failed request returns a JSON object with the following properties:

Property

Description

message

A string containing a brief message about the status of your request — e.g. “Contact #24 not found”.

Sample request

            PUT /rest/v1/contacts/24 HTTP/1.1
Host: company-id.app.openair.com
Content-Type: appplication/json
Authorization: Bearer <OAuth2_access_token>

{
   "jobTitle": "Head of Finance",
   "email": "jdoe@example.com",
   "customerId": 68,
} 

          

In the example, <OAuth2_access_token> is the OAuth 2.0 access token obtained for the client application connecting to OpenAir. See Authentication.

Sample response

            {
   "data": [
      {
         "id": 24
      }
   ],
   "message": "success"
}