Quickstart
This guide will walk you through the essential steps to integrate your AI tool with Memoram.
Integration Process Overview
- Register your Application: Create a developer account and register your application in the Memoram Developer Portal.
- Get API Key: Obtain your developer API key from the Developer Portal.
- Get JWT Token: Exchange your API key for a short-lived JWT Bearer Token using the
/auth/token
endpoint. This token is required for most subsequent API calls. - Implement User Authorization (OAuth 2.0): Redirect users to Memoram to grant your application permission to access their memory.
- Exchange Authorization Code: Exchange the received authorization code for user-specific tokens and the crucial
memory_key
using the/oauth/token
endpoint. - Request Access Credentials: Use the
memory_key
and your JWT to request access via the/access-requests
endpoint. The user approves this in their Memoram dashboard. - Get Encryption Key: Once approved, retrieve the user’s
encryption_key
from/access-requests/{request_id}/credentials
. - Access Memory Blobs: Use your JWT, the user’s ID, and the
encryption_key
to retrieve, create, update, or delete memory blobs using the/memory-blobs
endpoints. - Manage Tags: Retrieve available tags using the
/tags
endpoints.
Authentication and Authorization
Memoram uses two primary methods for securing API access:
- Developer JWT Token: For authenticating your application itself.
- User OAuth 2.0 Flow: For authorizing your application to access a specific user’s memory.
1. Getting Your Developer JWT Token
Before making most API calls, you need a short-lived JWT Bearer token. Exchange your permanent developer API key (found in the Developer Portal) for this token.
The response will contain your JWT (token
field). Include this token in the Authorization: Bearer <token>
header for subsequent API calls.
2. Authorizing User Memory Access (OAuth 2.0 - Conceptual Overview)
While the full OAuth 2.0 flow (redirecting users, handling callbacks) is standard, the key Memoram-specific steps involve:
a. Getting the User’s Memory Key: After a user successfully authenticates and authorizes your app via the standard OAuth redirect_uri
callback, you will receive an authorization_code
. Exchange this code for tokens.
b. Receiving Tokens and Memory Key: The response to the code exchange includes the user’s memory_key
.
c. Requesting Access via API: Now, using your Developer JWT Token, you request formal access using the user’s memory_key
.
d. User Approval: The user sees this request in their Memoram dashboard and must approve it.
e. Getting Credentials: Once approved, use the request ID from step (c) to fetch the user’s ID and the necessary encryption_key
.
Now you have the user_id
and encryption_key
needed to interact with the /memory-blobs
and /tags
endpoints for that specific user.