/people/{vanId}/relationships

Use this endpoint to create a single Relationship between two People.

The Person indicated in the body of the request is the “source” of the relationship, and the Person indicated in the URL route is the “destination” of the relationship. In this case, Person 7890123 is the mother of Person 123123.

If the Person specified in the URL route does not exist, this endpoint will return an error with HTTP Status Code 404 Not Found.

If the Relationship or Person specified in the request body are not available, this endpoint will return an error or errors with HTTP Status Code 400 Bad Request.

If successful, the endpoint responds with HTTP Status Code 204 No Content and an empty response body.

Using public users

It is possible to use the Public users system to describe a relationship between a Person and a Public User. Typically this approach is used to create a relationship between a voter in the My Voters and a My Campaign record. To do so:

Step 1. Create a My Campaign record with the relevant public user identifier, as follows: `POST /people/findOrCreate1

{
  "firstName": "Becky",
  "lastName": "Smith",
  "identifiers": [
    {
      "type": "AcmeCRMId",
      "externalId": "becky.smith"
    }
  ]
}

Step 2. Use the public user identifier when creating the relationship, leaving the vanId property null in the request body, as follows:

POST /people/1234/relationships
Headers:
X-NGPVAN-User-Type: QWNtZUNSTUlk
X-NGPVAN-User-Token: YmVja3kuc21pdGg=

{
  "relationshipId": 34
}

Note that the value of the X-NGPVAN-User-Type header is the result of Base64-encoding “AcmeCRMId”, and the value of the X-NGPVAN-User-Token header is the result of Base64-encoding “becky.smith”. As a result of this request, a relationship will be created between the voter with VANID 1234, and the MyCampaign record created in Step 1.

Language
Authorization
Basic
base64
:
Click Try It! to start a request and see the response here!