Add Custom Field onto Party

61 views
Skip to first unread message

Matthew Bristow

unread,
Jan 8, 2019, 8:38:12 AM1/8/19
to Capsule API
Hello,

Is it possible to add a custom field onto the body of the party (in v1 you would include the PartyID) without creating a field definition on the capsule account?

Many thanks,
Matt

andrew...@zestia.com

unread,
Jan 8, 2019, 9:01:25 AM1/8/19
to Capsule API
Hi Matt,

To add an existing custom field to a party, the request would look like:

// PUT /api/v2/parties/123
{
 
"party": {
   
"fields": [{
     
"value": "Test",
     
"definition": {
       
"id": 456
     
}
   
}]
 
}
}

When retrieving the party, make sure to include ?embed=fields on the URL, this will return:

// GET /api/v2/parties/123?embed=fields
{
  "party": {
    "id": 123,
    "fields": [{
      "id": 789,
      "value": "Test",
      "definition": {
        "id": 456,
        "name": "Your existing custom field"
      }
    }]
  }
}
Reply all
Reply to author
Forward
0 new messages