Skip to content

x[DRAFT] Read Memories

Daniel Marshall edited this page Jul 20, 2015 · 1 revision

Read Memories Using the FamilySearch PHP SDK

This document applies to web apps that use PHP to connect to the FamilySearch API. Explanations, suggestions, and code samples are provided for the following Memory read operations.

  • Read Person Memories
  • (future) Read User Memories

Prerequisites

  • Establish the operating environment described in the FamilySearch PHP SDK Authentication document. You should have the PHP SDK library (gedcomx-php) loaded, a PHP server running, and an access token retrieved.

Read Memories Setup

Place the example files in your FamilySearch PHP SDK test project directory. Copy or download a zip file of the Read Memories example files. At this point, make sure you have the following files in your project directory:

familysearch-auth.php
read-person-memories.php
read-user-memories.php

Usage

Read Person Memories (PID)

When you read memories of a person by PID, you receive a link to the person, and links to each referenced memory persona for that person.

You can then read the memories, and read the comments to the memories.

The information you read can be cached in local memory to potentially increase the performance of your app. See the Caching guide.

You should read person memories when you have a PID and you want to read the memories of that person.

####Sample Code—Read Person Memories

In your browser, access the read-person-memories.php file (at http://localhost:5000/read-person-memories.php if you are using the embedded server) and enter a PID of a person in your sandbox. You can get a PID by logging in to your sandbox and viewing a person's information.

The app will access the read-person-memories.php file in your PHP SDK project directory and display information about the person's memories and memory comments.

Read User Memories (Not currently available)

When you read the current user's memories, you receive the following:

  • Links to the previous, next, and current memory.
  • A link to the comments of the current memory.
  • A link to the current memory.

Read current user memories if you want to find or list the memories that the current user has submitted.

####Sample Code—Read User Memories

In your browser, access the read-user-memories.php file in your PHP SDK project directory (at http://localhost:5000/read-user-memories.php if you are using the embedded server), and examine the information displayed.

#Congratulations!

You have just used the FamilySearch PHP SDK to access Family Tree person memories.

For more PHP SDK sample code see the PHP SDK functional test suite.