Relationships

This endpoint is a BETA endpoint and not currently available in the mobile or web application.

This endpoint provides a list of relationships in R0. Relationships track more granular data about how you and your contacts are related. R0 then provides additional tools to view and manage these relationships. For example, you can track your partner(s) and anniversary dates as well as set reminders for these dates.

Since relationships are two sided the inverse of a relationship may be included within the relationship_id field. For example, a parent and child will reference each other. When a user relationship is created, if there's a record in the relationship_id field another record will automatically be created for the other individual in the relationship.

Example:

The relationships table includes a parent and child among several other records:

...{
        "id": "3c200a99-be4c-4c98-abaf-cd1a4e1267fc",
        "name": "Child",
        "relationship_id": "c4f653ed-1506-4c19-881c-e746f4272966"
},
{
        "id": "c4f653ed-1506-4c19-881c-e746f4272966",
        "name": "Parent",
        "relationship_id": "3c200a99-be4c-4c98-abaf-cd1a4e1267fc"
},...

The user's table includes a record for Bart (id = 492788b9-be39-4923-b6a8-0850feee232aand Marge Simpson (id = 6a909023-a55d-419b-bb39-8b3fb9ebe1ac). So creating a relationship with Bart/Marge only requires making one request to manage both sides of a relationship:

curl https://web.r0app.com/api/v1/orgs/:org_id/contacts/6a909023-a55d-419b-bb39-8b3fb9ebe1ac/contact_relationships
    -X POST \
    -d 'contact_relationship[second_contact_id]=492788b9-be39-4923-b6a8-0850feee232a' \
    -d 'contact_relationship[relationship_id]=3c200a99-be4c-4c98-abaf-cd1a4e1267fc' \
    -H 'Authorization: Bearer <token>'

Resources

Fetch a list of available relationships

GET https://web.r0app.com/api/v1/relationships

Returns a list of types of relationships available in R0.

Example request

curl https://web.r0app.com/api/v1/relationships \
    -X GET \
    -H 'Authorization: Bearer <token>'

User & contact relationships

These endpoints help you manage your relationships with your contacts (user_relationships) and the relationships your contacts have with each other (contact_relationships).

Last updated