Prerequisite
All requests to create, edit, or delete RELAYTO/ experiences must be authenticated with a USER_ACCESS_TOKEN
. For details on how to acquire this token, please see How to acquire a user access token.
Important: You should call the API from your own RELAYTO instance domain, for example: https://companyName.relayto.com
, not https://relayto.com
.
Create a new RELAYTO/ experience from a PDF file
Endpoint: POST /api/v1/content/file
curl -X POST
https://companyName.relayto.com/api/v1/content/file
-H 'authorization: Bearer USER_ACCESS_TOKEN'
-H 'content-type: multipart/form-data'
-F 'file=@PDF_BIN_FILE'
Response (JSON):
{
"id": "EXPERIENCE_ID",
"url": "https://relayto.com/PATH_TO_NEW_CONTENT_EXPERIENCE",
"privacy": "PRIVACY_TYPE"
}
Return Data Types:
id
(string): Unique identifier of the new RELAYTO/ experience.url
(string): Direct link to the newly created RELAYTO/ experience.
Note: It will partly change when the experience is renamed. Older URLs will be redirected to the latest one.privacy
(string): Privacy setting applied to the RELAYTO/ experience:public
,unlisted
, orprivate
.
List RELAYTO/ experiences
Endpoint: GET /api/v1/content
You can retrieve a paginated list of experiences with various filters and sorting options.
curl -X GET
https://companyName.relayto.com/api/v1/content
-H 'authorization: Bearer USER_ACCESS_TOKEN'
Query Parameters:
page
(integer, default=1): Page number, starting from 1.limit
(integer, default=10): Number of items per page. Maximum is 50.orderBy
(string, default="updated"): Field to sort by.
Response (JSON):
{
"items": [...],
"pagination": {
"total": 1,
"page": 1,
"limit": 10,
"pages": 1,
"hasNext": false,
"hasPrev": false
}
}
Delete a RELAYTO/ experience
Endpoint: DELETE /api/v1/content/{slug}
Deletes a RELAYTO/ experience by its slug
. Only allowed if you have edit permissions.
curl -X DELETE
https://companyName.relayto.com/api/v1/content/SLUG
-H 'authorization: Bearer USER_ACCESS_TOKEN'
Response:
true