Upload Story Memories

This example request illustrates how to upload multiple stories using a multipart request. To do this, post the story to the Memories resource with the Content-Type set to multipart/mixed. Provide the description of each resource in the first part. Include the title and the qualifiers and any other metadata. Provide the text of each story in each subsequent part with the Content-Type set to text/plain.

JSON

Request

POST /platform/memories/memories
Content-Type: multipart/mixed; boundary=Boundary_6_bHash_bTimestamp
Accept: application/x-fs-v1+xml
Authorization: Bearer YOUR_ACCESS_TOKEN_HERE
MIME-Version: 1.0--Boundary_6_bHash_bTimestamp
Content-Type: application/x-gedcomx-v1+json

{
  "sourceDescriptions" : [ {
    "about" : "cid:random_uuid1",
    "titles" : [ {
      "value" : "Grandfather's Horse"
    } ],
    "artifactMetadata" : [ {
      "qualifiers" : [ {
        "name" : "http://familysearch.org/v1/Story"
      } ]
    } ]
  }, {
    "about" : "cid:random_uuid2",
    "titles" : [ {
      "value" : "Stinky Socks"
    } ],
    "artifactMetadata" : [ {
      "qualifiers" : [ {
        "name" : "http://familysearch.org/v1/Story"
      } ]
    } ]
  } ]
}
--Boundary_6_bHash_bTimestamp
Content-ID: random_uuid1
Content-Disposition: attachment; filename="earl-horse.txt"
Content-Type: text/plain

...content of the first story...
--Boundary_6_bHash_bTimestamp
Content-ID: random_uuid2
Content-Disposition: attachment; filename="stinky-socks.html"
Content-Type: text/html

...content of the second story...
--Boundary_6_bHash_bTimestamp--

Response

HTTP/1.1 201 Created
Content-type: application/x-fs-v1+xml
X-entity-id: 67890
X-entity-id: 12345
X-processing-time: 3
Vary: Accept,Accept-Language,Accept-Encoding,Expect
Date: Sun, 03 Apr 1836 10:00:00 GMT-5
Cache-control: no-cache, no-store, no-transform, must-revalidate, max-age=0
Transfer-encoding: chunked

XML

Request

POST /platform/memories/memories
Content-Type: multipart/mixed; boundary=Boundary_4_bHash_bTimestamp
Accept: application/x-fs-v1+xml
Authorization: Bearer YOUR_ACCESS_TOKEN_HERE
MIME-Version: 1.0--Boundary_4_bHash_bTimestamp
Content-Type: application/x-gedcomx-v1+xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<gedcomx xmlns:fs="http://familysearch.org/v1/" xmlns="http://gedcomx.org/v1/" xmlns:atom="http://www.w3.org/2005/Atom">
    <sourceDescription about="cid:random_uuid1">
        <fs:artifactMetadata>
            <fs:qualifier name="http://familysearch.org/v1/Story"/>
        </fs:artifactMetadata>
        <title>Grandfather's Horse</title>
    </sourceDescription>
    <sourceDescription about="cid:random_uuid2">
        <fs:artifactMetadata>
            <fs:qualifier name="http://familysearch.org/v1/Story"/>
        </fs:artifactMetadata>
        <title>Stinky Socks</title>
    </sourceDescription>
</gedcomx>

--Boundary_4_bHash_bTimestamp
Content-ID: random_uuid1
Content-Disposition: attachment; filename="earl-horse.txt"
Content-Type: text/plain

...content of the first story...
--Boundary_4_bHash_bTimestamp
Content-ID: random_uuid2
Content-Disposition: attachment; filename="stinky-socks.html"
Content-Type: text/html

...content of the second story...
--Boundary_4_bHash_bTimestamp--

Response

HTTP/1.1 201 Created
Content-type: application/x-fs-v1+xml
X-entity-id: 67890
X-entity-id: 12345
X-processing-time: 3
Vary: Accept,Accept-Language,Accept-Encoding,Expect
Date: Sun, 03 Apr 1836 10:00:00 GMT-5
Cache-control: no-cache, no-store, no-transform, must-revalidate, max-age=0
Transfer-encoding: chunked