Upload Image as a Document

This example request illustrates how to upload an image as a document via multipart form data. To do this, post the image to the Memories resource with the Content-Type set to the media type of the image. Provide the title of the photo as a query parameter called "title". Provide the filename using the Content-Disposition header. Set the artifact type to document.

Request

POST /platform/memories/memories
Content-Type: multipart/form-data; boundary=Boundary_3_bHash_bTimestamp
Authorization: Bearer YOUR_ACCESS_TOKEN_HERE
MIME-Version: 1.0

--Boundary_3_bHash_bTimestamp
Content-Type: text/plain
Content-Disposition: form-data; name="title"

Birth Certificate
--Boundary_3_bHash_bTimestamp
Content-Type: text/plain
Content-Disposition: form-data; name="type"

Document
--Boundary_3_bHash_bTimestamp
Content-Type: image/jpeg
Content-Disposition: form-data; filename="birth-certificate.jpg"; name="artifact"

...(binary bytes of the image)...
--Boundary_3_bHash_bTimestamp--

Response

HTTP/1.1 201 Created
Content-type: text/html
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
Location: https://api.familysearch.org/platform/memories/memories/12345
Transfer-encoding: chunked