Create Child and Parents Relationship

This example request illustrates how to create a child and parents relationship. This describes the relationship between two parents and a child.

JSON

Request

POST /platform/tree/relationships
Content-Type: application/x-fs-v1+json
Authorization: Bearer YOUR_ACCESS_TOKEN_HERE{
  "childAndParentsRelationships" : [ {
    "parent1" : {
      "resource" : "https://api.familysearch.org/platform/tree/persons/PPPX-MP1",
      "resourceId" : "PPPX-MP1"
    },
    "parent2" : {
      "resource" : "https://api.familysearch.org/platform/tree/persons/PPPX-FP2",
      "resourceId" : "PPPX-FP2"
    },
    "child" : {
      "resource" : "https://api.familysearch.org/platform/tree/persons/PPPX-PP3",
      "resourceId" : "PPPX-PP3"
    },
    "parent1Facts" : [ {
      "id" : "C.1",
      "attribution" : {
        "contributor" : {
          "resource" : "https://api.familysearch.org/platform/users/agents/JNYR-KJP"
        },
        "changeMessage" : "...change message..."
      },
      "type" : "http://gedcomx.org/AdoptiveParent"
    } ],
    "parent2Facts" : [ {
      "id" : "C.2",
      "attribution" : {
        "contributor" : {
          "resource" : "https://api.familysearch.org/platform/users/agents/JNYR-KJP"
        },
        "changeMessage" : "...change message..."
      },
      "type" : "http://gedcomx.org/BiologicalParent"
    } ]
  } ]
}

Response

HTTP/1.1 201 Created
Content-type: text/html
X-entity-id: PPPX-PP0
X-processing-time: 3
Vary: Accept,Accept-Language,Accept-Encoding,Expect
Link: <https://api.familysearch.org/platform/tree/child-and-parents-relationships/PPPX-PP0/source-references?flag=fsh>; rel="source-references"
Link: <https://api.familysearch.org/platform/tree/child-and-parents-relationships/PPPX-PP0/notes?flag=fsh>; rel="notes"
Date: Sun, 03 Apr 1836 10:00:00 GMT-5
Location: https://api.familysearch.org/platform/tree/child-and-parents-relationships/PPPX-PP0
Transfer-encoding: chunked

XML

Request

POST /platform/tree/relationships
Content-Type: application/x-fs-v1+xml
Authorization: Bearer YOUR_ACCESS_TOKEN_HERE<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fs:familysearch xmlns:fs="http://familysearch.org/v1/" xmlns="http://gedcomx.org/v1/" xmlns:atom="http://www.w3.org/2005/Atom">
    <fs:childAndParentsRelationship>
        <fs:parent1 resource="https://api.familysearch.org/platform/tree/persons/PPPX-MP1" resourceId="PPPX-MP1"/>
        <fs:parent2 resource="https://api.familysearch.org/platform/tree/persons/PPPX-FP2" resourceId="PPPX-FP2"/>
        <fs:child resource="https://api.familysearch.org/platform/tree/persons/PPPX-PP3" resourceId="PPPX-PP3"/>
        <fs:parent1Fact type="http://gedcomx.org/AdoptiveParent" id="C.1">
            <attribution>
                <contributor resource="https://api.familysearch.org/platform/users/agents/JNYR-KJP"/>
                <changeMessage>...change message...</changeMessage>
            </attribution>
        </fs:parent1Fact>
        <fs:parent2Fact type="http://gedcomx.org/BiologicalParent" id="C.2">
            <attribution>
                <contributor resource="https://api.familysearch.org/platform/users/agents/JNYR-KJP"/>
                <changeMessage>...change message...</changeMessage>
            </attribution>
        </fs:parent2Fact>
    </fs:childAndParentsRelationship>
</fs:familysearch>

Response

HTTP/1.1 201 Created
Content-type: text/html
X-entity-id: PPPX-PP0
X-processing-time: 3
Vary: Accept,Accept-Language,Accept-Encoding,Expect
Link: <https://api.familysearch.org/platform/tree/child-and-parents-relationships/PPPX-PP0/source-references?flag=fsh>; rel="source-references"
Link: <https://api.familysearch.org/platform/tree/child-and-parents-relationships/PPPX-PP0/notes?flag=fsh>; rel="notes"
Date: Sun, 03 Apr 1836 10:00:00 GMT-5
Location: https://api.familysearch.org/platform/tree/child-and-parents-relationships/PPPX-PP0
Transfer-encoding: chunked