Upload Multiple Photo Memories

This example request illustrates how to upload multiple photo memories 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 titles, qualifiers and any other metadata. Provide the filename of each photo in each subsequent part with the Content-Type set to image/jpeg.

JSON

Request

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

{
  "sourceDescriptions" : [ {
    "about" : "cid:random_uuid1",
    "titles" : [ {
      "value" : "Missionary Portrait"
    } ],
    "descriptions" : [ {
      "value" : "Alma Heaton while on a mission to Canada."
    } ],
    "artifactMetadata" : [ {
      "qualifiers" : [ {
        "name" : "http://familysearch.org/v1/Photo"
      } ]
    } ]
  }, {
    "about" : "cid:random_uuid2",
    "titles" : [ {
      "value" : "Record Player"
    } ],
    "descriptions" : [ {
      "value" : "Alma Heaton using his favorite record player."
    } ],
    "artifactMetadata" : [ {
      "qualifiers" : [ {
        "name" : "http://familysearch.org/v1/Photo"
      } ]
    } ]
  } ]
}
--Boundary_7_bHash_bTimestamp
Content-ID: random_uuid1
Content-Disposition: attachment; filename="alma-mission.jpg"
Content-Type: image/jpeg

...binary bytes of the first image...
--Boundary_7_bHash_bTimestamp
Content-ID: random_uuid2
Content-Disposition: attachment; filename="alma-record-player.png"
Content-Type: image/png

...binary bytes of the second image...
--Boundary_7_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_5_bHash_bTimestamp
Accept: application/x-fs-v1+xml
Authorization: Bearer YOUR_ACCESS_TOKEN_HERE
MIME-Version: 1.0--Boundary_5_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/Photo"/>
        </fs:artifactMetadata>
        <title>Missionary Portrait</title>
        <description>Alma Heaton while on a mission to Canada.</description>
    </sourceDescription>
    <sourceDescription about="cid:random_uuid2">
        <fs:artifactMetadata>
            <fs:qualifier name="http://familysearch.org/v1/Photo"/>
        </fs:artifactMetadata>
        <title>Record Player</title>
        <description>Alma Heaton using his favorite record player.</description>
    </sourceDescription>
</gedcomx>

--Boundary_5_bHash_bTimestamp
Content-ID: random_uuid1
Content-Disposition: attachment; filename="alma-mission.jpg"
Content-Type: image/jpeg

...binary bytes of the first image...
--Boundary_5_bHash_bTimestamp
Content-ID: random_uuid2
Content-Disposition: attachment; filename="alma-record-player.png"
Content-Type: image/png

...binary bytes of the second image...
--Boundary_5_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