Resources
Resource Details API
One topic by slug, or all resources inside one list.
Returns the details of a single topic, or the resources contained in a single list.
GET https://api.crediblemind.com/{client}/resources/{type}/{slug}Parameters
| Name | In | Type | Required | Notes |
|---|---|---|---|---|
x-api-key | header | string | Yes | Your API key. See Authentication. |
client | path | string | Yes | Your client identifier. |
type | path | string | Yes | topics or lists. |
slug | path | string | Yes | The topic or list slug, from the Topics API or Lists API. |
Request
curl "https://api.crediblemind.com/acme/resources/lists/best-apps-for-better-sleep" \
-H "x-api-key: YOUR_API_KEY"Response for a list
The resources in the list, after removing resource types and articles your client excludes:
{
"numResults": 1,
"results": [
{
"entryId": "5xYc0eWbB3kq8mN2pQ7rTz",
"title": "Calm",
"subtitle": "Meditation and sleep stories to help you relax.",
"organization": "Calm.com, Inc.",
"type": "App",
"imageUrl": "https://images.ctfassets.net/example/calm.png",
"primaryTopic": "Sleep",
"slug": "calm",
"path": "apps/calm",
"tags": ["Editor's Pick"],
"featured": false,
"averageRating": 4.6
}
]
}Response for a topic
The topic itself, with the same fields as one item above:
{
"entryId": "3kTq9vX2bLmR7nP4sW8yZa",
"title": "Anxiety",
"subtitle": "Understand anxiety and find ways to manage it.",
"type": "Topic",
"imageUrl": "https://images.ctfassets.net/example/anxiety.jpg",
"slug": "anxiety",
"path": "topics/anxiety",
"tags": [],
"featured": false
}| Field | Type | Always present | Description |
|---|---|---|---|
numResults | number | Lists only | Number of resources in results. |
entryId | string | Yes | Unique identifier of the resource. |
title | string | Yes | Title. |
subtitle | string | No | Short description. |
author | string | No | Author, when the resource has one. |
organization | string | No | Organization behind the resource, when it has one. |
type | string | Yes | Resource type, singular, for example Topic, Article, Video, App. |
imageUrl | string | No | Image. |
primaryTopic | string | No | The resource's primary topic. |
slug | string | Yes | Slug. |
path | string | No | Path of the resource, without a leading /, for example apps/calm. Missing for resource types that have no page on the CredibleMind site. |
tags | string[] | Yes | Tags and audiences. May be empty. |
featured | boolean | Yes | Reserved for future use. |
averageRating | number | No | Average rating, when the resource has one. |
Only published (accepted) topics and lists are returned. A topic your client excludes by resource type comes back as 200 with an empty object {}.
Errors
| Status | Body | When |
|---|---|---|
400 | Validation envelope, shown below | type is not topics or lists. |
401 | { "error": "Invalid API Client or Key" } | The key is missing or does not match client. |
404 | { "error": "Resource not found" } | No published topic or list has this slug. |
500 | { "error": "Internal server error" } | Unexpected server error. |
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Request validation failed",
"issues": [
{ "path": "type", "message": "Type must be either 'topics' or 'lists'" }
]
}
}