NAV Navbar
shell javascript

Introduction

Welcome to the Tribe API!

We have language bindings in Shell and JavaScript! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

Authentication

To authorize, use this code:

# With shell, you can just pass the correct header with each request
curl "api_endpoint_here"
  -H "Authorization: <YourAccessToken>"
const tribe = require('tribe');

let api = tribe.authorize('<YourAccessToken>');

Make sure to replace <YourAccessToken> with your API key.

Tribe uses API keys to allow access to the API. You can request a new Tribe API key by contacting us.

Tribe expects for the API key to be included in all API requests to the server in a header that looks like the following:

Authorization: <YourAccessToken>

Answers

Get All Answers

curl "https://community.tribe.so/api/v1/answers"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let answers = api.answers.get();

The above command returns JSON structured like this:

[
  {
    "_id": "5bf0e89ada3be54c190b78ba",
    "updatedAt": "2018-12-03T22:20:11.069Z",
    "createdAt": "2018-11-18T04:20:42.892Z",
    "draftContent": "",
    "portal": "5a73b1fcc48071e4c4dc1cae",
    "question": {
      "_id": "5bf0e860da3be54c190b78b8",
      "shortId": "5okGL",
      "updatedAt": "2018-12-03T23:26:53.588Z",
      "createdAt": "2018-11-18T04:19:44.936Z",
      "title": "Can I embed external services (YouTube, Vimeo, etc.) in my answers or posts?",
      "user": {
        "_id": "5bacc9ff630b876a1e9785f7",
        "profile": {
          "counts": {
            "requests": 0,
            "edits": 0,
            "questionsFollowers": 0,
            "questions": 8,
            "comments": 0,
            "answersWords": 615,
            "answersVotes": 0,
            "answersViews": 0,
            "answers": 3,
            "views": 0,
            "followings": 0,
            "followers": 0
          },
          "score": 13,
          "externalId": null,
          "verified": false,
          "description": "",
          "title": "",
          "picture": "/files/users/5f7/5bacc9ff630b876a1e9785f7_15302.png",
          "website": "",
          "location": "",
          "gender": "",
          "name": "Robert D",
          "username": "robertd"
        },
        "id": "5bacc9ff630b876a1e9785f7"
      },
      "publishedAt": "2018-11-18T04:19:44.933Z",
      "portal": "5a73b1fcc48071e4c4dc1cae",
      "lastAskedAt": "2018-11-18T04:19:44.933Z",
      "actor": "5b1f99a7478dd3768d84b646",
      "__v": 1,
      "lastAnsweredAt": "2018-11-18T04:25:42.040Z",
      "referrers": [],
      "rewards": [],
      "hasReward": false,
      "downvotes": [],
      "upvotes": [],
      "followers": [],
      "askers": [],
      "comments": [],
      "topics": [
        {
          "_id": "5b88264d3d9228aa7c41f692",
          "name": "Tribe",
          "user": {
            "_id": "5b881b2a90ecbe6751123d7e",
            "profile": {
              "counts": {
                "requests": 2,
                "edits": 148,
                "questionsFollowers": 0,
                "questions": 32,
                "comments": 0,
                "answersWords": 5753,
                "answersVotes": 0,
                "answersViews": 0,
                "answers": 31,
                "views": 0,
                "followings": 1,
                "followers": 2
              },
              "score": 115,
              "externalId": null,
              "verified": false,
              "description": "<p>&nbsp;</p>",
              "title": "Biomedical Engineer ",
              "picture": "/files/users/d7e/5b881b2a90ecbe6751123d7e_57697.png",
              "website": "",
              "location": "",
              "gender": "",
              "name": "Elnaz Najafi",
              "username": "elnajafi89"
            },
            "id": "5b881b2a90ecbe6751123d7e"
          },
          "picture": "/files/topics/692/5b88264d3d9228aa7c41f692_72807.png",
          "id": "5b88264d3d9228aa7c41f692"
        }
      ],
      "score": 0,
      "status": "published",
      "counts": {
        "asks": 1,
        "downvotes": 0,
        "upvotes": 0,
        "edits": 2,
        "comments": 0,
        "hiddenAnswers": 0,
        "answers": 1,
        "views": 33,
        "followers": 0
      },
      "type": "general",
      "privacy": "public",
      "anonymous": false,
      "verified": false,
      "locked": false,
      "id": "5bf0e860da3be54c190b78b8"
    },
    "user": {
      "_id": "5b1f99a7478dd3768d84b646",
      "profile": {
        "counts": {
          "requests": 2,
          "edits": 46,
          "questionsFollowers": 0,
          "questions": 2,
          "comments": 2,
          "answersWords": 1586,
          "answersVotes": 0,
          "answersViews": 0,
          "answers": 12,
          "views": 0,
          "followings": 3,
          "followers": 3
        },
        "score": 52,
        "externalId": null,
        "verified": true,
        "description": "<p>&nbsp;</p>",
        "title": "Tribe Moderator",
        "picture": "/files/users/646/5b1f99a7478dd3768d84b646_66172.png",
        "website": "",
        "location": "",
        "gender": "male",
        "name": "Siavash Mahmoudian",
        "username": "siavash"
      },
      "id": "5b1f99a7478dd3768d84b646",
      "followed": false
    },
    "__v": 1,
    "publishedAt": "2018-11-18T04:25:42.037Z",
    "shortId": "PEVpN",
    "downvotes": [],
    "upvotes": [
      "5bc64d97a8c76d6d771ae914"
    ],
    "comments": [],
    "rewards": [],
    "images": [],
    "links": [],
    "score": 0,
    "global": true,
    "status": "published",
    "media": [],
    "counts": {
      "reasks": 0,
      "edits": 2,
      "downvotes": 0,
      "upvotes": 1,
      "comments": 0,
      "views": 34
    },
    "privacy": "public",
    "anonymous": false,
    "verified": false,
    "summary": "...",
    "id": "5bf0e89ada3be54c190b78ba",
    "upvoted": false,
    "downvoted": false,
    "intro": "..."
  }
]

This endpoint retrieves all answers.

HTTP Request

GET /api/v1/answers

Query Parameters

Parameter Default Description
page 1 Intended page
limit 20 Number of items per page
sort createdAt.desc The field to sort on

Get a Specific Answer

curl "https://community.tribe.so/api/v1/answers/5bf0e89ada3be54c190b78ba"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let answers = api.answers.get('5bf0e89ada3be54c190b78ba');

The above command returns JSON structured like this:

{
  "_id": "5bf0e89ada3be54c190b78ba",
  "updatedAt": "2018-12-03T22:20:11.069Z",
  "createdAt": "2018-11-18T04:20:42.892Z",
  "draftContent": "",
  "portal": "5a73b1fcc48071e4c4dc1cae",
  "question": {
    "_id": "5bf0e860da3be54c190b78b8",
    "shortId": "5okGL",
    "updatedAt": "2018-12-03T23:26:53.588Z",
    "createdAt": "2018-11-18T04:19:44.936Z",
    "title": "Can I embed external services (YouTube, Vimeo, etc.) in my answers or posts?",
    "user": {
      "_id": "5bacc9ff630b876a1e9785f7",
      "profile": {
        "counts": {
          "requests": 0,
          "edits": 0,
          "questionsFollowers": 0,
          "questions": 8,
          "comments": 0,
          "answersWords": 615,
          "answersVotes": 0,
          "answersViews": 0,
          "answers": 3,
          "views": 0,
          "followings": 0,
          "followers": 0
        },
        "score": 13,
        "externalId": null,
        "verified": false,
        "description": "",
        "title": "",
        "picture": "/files/users/5f7/5bacc9ff630b876a1e9785f7_15302.png",
        "website": "",
        "location": "",
        "gender": "",
        "name": "Robert D",
        "username": "robertd"
      },
      "id": "5bacc9ff630b876a1e9785f7"
    },
    "publishedAt": "2018-11-18T04:19:44.933Z",
    "portal": "5a73b1fcc48071e4c4dc1cae",
    "lastAskedAt": "2018-11-18T04:19:44.933Z",
    "actor": "5b1f99a7478dd3768d84b646",
    "__v": 1,
    "lastAnsweredAt": "2018-11-18T04:25:42.040Z",
    "referrers": [],
    "rewards": [],
    "hasReward": false,
    "downvotes": [],
    "upvotes": [],
    "followers": [],
    "askers": [],
    "comments": [],
    "topics": [
      {
        "_id": "5b88264d3d9228aa7c41f692",
        "name": "Tribe",
        "user": {
          "_id": "5b881b2a90ecbe6751123d7e",
          "profile": {
            "counts": {
              "requests": 2,
              "edits": 148,
              "questionsFollowers": 0,
              "questions": 32,
              "comments": 0,
              "answersWords": 5753,
              "answersVotes": 0,
              "answersViews": 0,
              "answers": 31,
              "views": 0,
              "followings": 1,
              "followers": 2
            },
            "score": 115,
            "externalId": null,
            "verified": false,
            "description": "<p>&nbsp;</p>",
            "title": "Biomedical Engineer ",
            "picture": "/files/users/d7e/5b881b2a90ecbe6751123d7e_57697.png",
            "website": "",
            "location": "",
            "gender": "",
            "name": "Elnaz Najafi",
            "username": "elnajafi89"
          },
          "id": "5b881b2a90ecbe6751123d7e"
        },
        "picture": "/files/topics/692/5b88264d3d9228aa7c41f692_72807.png",
        "id": "5b88264d3d9228aa7c41f692"
      }
    ],
    "score": 0,
    "status": "published",
    "counts": {
      "asks": 1,
      "downvotes": 0,
      "upvotes": 0,
      "edits": 2,
      "comments": 0,
      "hiddenAnswers": 0,
      "answers": 1,
      "views": 33,
      "followers": 0
    },
    "type": "general",
    "privacy": "public",
    "anonymous": false,
    "verified": false,
    "locked": false,
    "id": "5bf0e860da3be54c190b78b8"
  },
  "user": {
    "_id": "5b1f99a7478dd3768d84b646",
    "profile": {
      "counts": {
        "requests": 2,
        "edits": 46,
        "questionsFollowers": 0,
        "questions": 2,
        "comments": 2,
        "answersWords": 1586,
        "answersVotes": 0,
        "answersViews": 0,
        "answers": 12,
        "views": 0,
        "followings": 3,
        "followers": 3
      },
      "score": 52,
      "externalId": null,
      "verified": true,
      "description": "<p>&nbsp;</p>",
      "title": "Tribe Moderator",
      "picture": "/files/users/646/5b1f99a7478dd3768d84b646_66172.png",
      "website": "",
      "location": "",
      "gender": "male",
      "name": "Siavash Mahmoudian",
      "username": "siavash"
    },
    "id": "5b1f99a7478dd3768d84b646",
    "followed": false
  },
  "__v": 1,
  "publishedAt": "2018-11-18T04:25:42.037Z",
  "shortId": "PEVpN",
  "downvotes": [],
  "upvotes": [
    "5bc64d97a8c76d6d771ae914"
  ],
  "comments": [],
  "rewards": [],
  "images": [],
  "links": [],
  "score": 0,
  "global": true,
  "status": "published",
  "media": [],
  "counts": {
    "reasks": 0,
    "edits": 2,
    "downvotes": 0,
    "upvotes": 1,
    "comments": 0,
    "views": 34
  },
  "privacy": "public",
  "anonymous": false,
  "verified": false,
  "summary": "...",
  "id": "5bf0e89ada3be54c190b78ba",
  "upvoted": false,
  "downvoted": false,
  "intro": "..."
}

This endpoint retrieves a specific answer using ID.

HTTP Request

GET /api/v1/answers/{id}

URL Parameters

Parameter Description
id The ID of the item

Delete a Specific Answer

curl "https://community.tribe.so/api/v1/answers/5bf0e89ada3be54c190b78ba"
  -X DELETE
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let result = api.answers.delete('5bf0e89ada3be54c190b78ba');

The above command returns JSON structured like this:

{
  "success": true
}

This endpoint deletes a specific answer.

HTTP Request

DELETE /api/v1/answers/{id}

URL Parameters

Parameter Description
ID The ID of the answer to delete

Feed

Get User Feed

curl "https://community.tribe.so/api/v1/feed"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let questions = api.user.feed();

The above command returns JSON structured like this:

[
  {
    "_id": "topics-1",
    "type": "Topics",
    "topics": [
      ...
    ],
    "description": "You have not picked any topics yet. Please pick some to improve this page."
  },
  {
    "_id": "5c0621864cb2b119dc174a63",
    "type": "Discussion",
    "publishedAt": "2018-12-04T06:41:10.031Z",
    "post": {
      ...
    }
  },
  {
    "_id": "5bf0e89ada3be54c190b78ba",
    "type": "Answer",
    "publishedAt": "2018-11-18T04:25:42.037Z",
    "answer": {
      ...
    }
  }
]

This endpoint retrieves user feed.

HTTP Request

GET /api/v1/feed

Query Parameters

Parameter Default Description
page 1 Intended page
limit 20 Number of items per page
sort createdAt.desc The field to sort on

Notification

Get User Notification

curl "https://community.tribe.so/api/v1/notifications"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let questions = api.notifications.list();

The above command returns JSON structured like this:

[
  {
    "_id": "5bf2ac9b86eb922c246e77ca",
    "emailAt": "2018-11-19T12:29:15.723Z",
    "updatedAt": "2018-11-19T12:29:15.722Z",
    "createdAt": "2018-11-19T12:29:15.722Z",
    "verb": "follow_user",
    "to": "5b1f99a7478dd3768d84b646",
    "__v": 0,
    "emailSent": false,
    "read": false,
    "objects": [],
    "from": [
      {
        "_id": "5bd164051f117e0440efb07c",
        "profile": {
          "picture": "https://gravatar.com/avatar/533db9190e9912306ed3334e3dba2a56?s=200&d=retro",
          "name": "Sayle",
          "username": "sayele"
        },
        "id": "5bd164051f117e0440efb07c"
      }
    ]
  },
  {
    "_id": "5bf210a61c546252b2d79030",
    "updatedAt": "2018-11-19T01:23:50.998Z",
    "createdAt": "2018-11-19T01:23:50.998Z",
    "verb": "upvote",
    "to": "5b1f99a7478dd3768d84b646",
    "__v": 0,
    "emailSent": false,
    "read": false,
    "objects": [
      {
        ...
      }
    ],
    "from": [
      {
        "_id": "5bd9d35ad242f810e3d84ab6",
        "profile": {
          "picture": "/files/users/ab6/5bd9d35ad242f810e3d84ab6_77365.png",
          "name": "Soheil Alavi",
          "username": "soheil"
        },
        "id": "5bd9d35ad242f810e3d84ab6"
      }
    ]
  },
  {
    "_id": "5be36b573fb95035bf9085a5",
    "emailAt": "2018-11-07T22:46:47.681Z",
    "updatedAt": "2018-11-07T22:46:47.679Z",
    "createdAt": "2018-11-07T22:46:47.679Z",
    "verb": "ask",
    "to": "5b1f99a7478dd3768d84b646",
    "__v": 0,
    "emailSent": false,
    "read": false,
    "objects": [
      {
        "_id": "5be36b573fb95035bf9085a3",
        "shortId": "QrmZ6",
        "updatedAt": "2018-11-22T22:09:56.432Z",
        "createdAt": "2018-11-07T22:46:47.522Z",
        "title": "What is Tribe's Privacy Policy?",
        "publishedAt": "2018-11-07T22:46:47.519Z",
        "portal": "5a73b1fcc48071e4c4dc1cae",
        "lastAskedAt": "2018-11-07T22:46:47.519Z",
        "actor": "5b3f7fe0d5a11b6297259cab",
        "__v": 2,
        "lastAnsweredAt": "2018-11-07T22:47:16.105Z",
        "referrers": [
          {
            "type": "social",
            "source": "facebook",
            "count": 1,
            "_id": "5be36fa23fb95035bf9085a8",
            "urls": []
          }
        ],
        "rewards": [],
        "hasReward": false,
        "askers": [],
        "score": 0,
        "status": "published",
        "type": "general",
        "privacy": "public",
        "anonymous": false,
        "verified": false,
        "locked": false,
        "id": "5be36b573fb95035bf9085a3"
      }
    ],
    "from": [
      {
        "_id": "5b913111f19a473232026877",
        "profile": {
          "picture": "/files/users/877/5b913111f19a473232026877_65884.png",
          "name": "Adrian Garcia",
          "username": "adriang"
        },
        "id": "5b913111f19a473232026877"
      }
    ]
  }
]

This endpoint retrieves user notifications.

HTTP Request

GET /api/v1/notifications

Query Parameters

Parameter Default Description
page 1 Intended page
limit 20 Number of items per page

Get User Notification Summary

curl "https://community.tribe.so/api/v1/notifications/summary"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let questions = api.notifications.summary();

The above command returns JSON structured like this:

{
  "count": "19"
}

This endpoint retrieves user notifications count.

HTTP Request

GET /api/v1/notifications/summary

Mark All Notifications as Read

curl "https://community.tribe.so/api/v1/notifications/summary"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let questions = api.notifications.read();

The above command returns JSON structured like this:

{
  "success": true
}

This endpoint marks all user notifications as read.

HTTP Request

POST /api/v1/notifications/read

Portal

Get Portal Information

curl "https://community.tribe.so/api/v1/portal"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let questions = api.portal.get();

The above command returns JSON structured like this:

{
  "_id": "5a73b1fcc48071e4c4dc1cae",
  "updatedAt": "2018-11-30T00:46:42.809Z",
  "createdAt": "2018-02-02T02:13:32.692Z",
  "name": "Tribe",
  "domain": "community.tribe.so",
  "baseUrl": "https://community.tribe.so",
  "moderators": [],
  "admins": [],
  "__v": 9,
  "englishName": "Tribe",
  "description": "Tribe is a cloud-based community platform that plugs into your marketing stack. Integrated with your social media, it helps you amplify the vibe around your business by allowing you and your customers to create content.",
  "keywords": "",
  "longName": "Tribe, a cloud based community platform",
  "favicon": "/files/portals/cae/favicon_19357.png",
  "logo": "/files/portals/cae/logo_59518.png",
  "banner": "/files/portals/cae/banner_96419.png",
  "apps": [],
  "announcement": {
    "title": "Forums are dead. Build your tribe.",
    "picture": "/files/portals/cae/announcement_79671.png",
    "link": "https://tribe.so/#request-form",
    "enabled": true,
    "content": "<p>Tribe is a cloud-based community platform that plugs into your marketing stack. Integrated with your social media, it helps you amplify the vibe around your business by allowing you and your customers to create content.&nbsp;</p>",
    "action": "Request Demo",
    "layout": "imageSidePadded"
  },
  "template": {
    "sidebar": "",
    "head": "",
    "css": "",
    "body": "",
    "menu": {
      "height": 65
    },
    "navbar": {
      "links": [
        {
          "_id": "5bf2400486eb922c246e77c5",
          "url": "https://tribe.so/features",
          "text": "Features",
          "position": "start"
        },
        {
          "_id": "5bf2400486eb922c246e77c4",
          "url": "https://tribe.so/services",
          "text": "Services",
          "position": "start"
        },
        {
          "_id": "5bf2400486eb922c246e77c3",
          "url": "https://tribe.so/#pricing",
          "text": "Pricing",
          "position": "start"
        },
        {
          "_id": "5bf2400486eb922c246e77c2",
          "url": "https://tribe.so/app-store",
          "text": "App Store",
          "position": "start"
        }
      ],
      "enabled": true,
      "linksString": "Features | https://tribe.so/features | start\nServices | https://tribe.so/services | start\nPricing | https://tribe.so/#pricing | start\nApp Store | https://tribe.so/app-store | start"
    },
    "colors": {
      "primary": "#26c964"
    },
    "theme": "default"
  },
  "messages": {
    "motto": "Join the community of community managers!"
  },
  "featured": {
    "posts": [],
    "events": [],
    "answers": [
      "5babcf33630b876a1e9785cd"
    ],
    "topics": [
      "5b912fcb3d9228aa7c4220dc",
      "5b9002da3d9228aa7c421ec4",
      "5b912f963d9228aa7c4220db",
      "5b8ffc353d9228aa7c421eb1",
      "5b9ad5883d9228aa7c422f0c",
      "5b88264d3d9228aa7c41f692"
    ],
    "users": [],
    "questions": []
  },
  "links": {
    "twitter": "",
    "telegram": "",
    "privacy": "/question/5be36b573fb95035bf9085a3",
    "linkedin": "",
    "instagram": "",
    "faq": "",
    "facebook": ""
  },
  "currency": {
    "external": {
      "name": "CAD"
    },
    "conversionRate": 1,
    "internal": {
      "name": "Coin"
    },
    "enabled": true
  },
  "counts": {
    "unapprovedAnswers": 0,
    "unapprovedQuestions": 0,
    "comments": 0,
    "unanswered": 25,
    "topics": 30,
    "answers": 72,
    "questions": 91,
    "users": 28
  },
  "sections": [],
  "policies": {
    "cookieConsent": "enabled",
    "registration": "public",
    "content": "shareable",
    "access": "public"
  },
  "stage": "inception",
  "status": "live",
  "type": "root",
  "plan": "basic",
  "topics": [
    {
      "_id": "5b9ad5883d9228aa7c422f0c",
      "name": "Online Community",
      "user": {
        "_id": "5b881b2a90ecbe6751123d7e",
        "profile": {
          "counts": {
            "requests": 2,
            "edits": 148,
            "questionsFollowers": 0,
            "questions": 32,
            "comments": 0,
            "answersWords": 5753,
            "answersVotes": 0,
            "answersViews": 0,
            "answers": 31,
            "views": 0,
            "followings": 1,
            "followers": 2
          },
          "score": 115,
          "externalId": null,
          "verified": false,
          "description": "<p>&nbsp;</p>",
          "title": "Biomedical Engineer ",
          "picture": "/files/users/d7e/5b881b2a90ecbe6751123d7e_57697.png",
          "website": "",
          "location": "",
          "gender": "",
          "name": "Elnaz Najafi",
          "username": "elnajafi89"
        },
        "id": "5b881b2a90ecbe6751123d7e"
      },
      "picture": "/files/topics/f0c/5b9ad5883d9228aa7c422f0c_586.png",
      "id": "5b9ad5883d9228aa7c422f0c"
    },
    {
      "_id": "5babb4603d9228aa7c423c23",
      "name": "Tribe Services",
      "user": {
        "_id": "5b881b2a90ecbe6751123d7e",
        "profile": {
          "counts": {
            "requests": 2,
            "edits": 148,
            "questionsFollowers": 0,
            "questions": 32,
            "comments": 0,
            "answersWords": 5753,
            "answersVotes": 0,
            "answersViews": 0,
            "answers": 31,
            "views": 0,
            "followings": 1,
            "followers": 2
          },
          "score": 115,
          "externalId": null,
          "verified": false,
          "description": "<p>&nbsp;</p>",
          "title": "Biomedical Engineer ",
          "picture": "/files/users/d7e/5b881b2a90ecbe6751123d7e_57697.png",
          "website": "",
          "location": "",
          "gender": "",
          "name": "Elnaz Najafi",
          "username": "elnajafi89"
        },
        "id": "5b881b2a90ecbe6751123d7e"
      },
      "picture": "/files/topics/c23/5babb4603d9228aa7c423c23_22837.png",
      "id": "5babb4603d9228aa7c423c23"
    },
    {
      "_id": "5bb1abe13d9228aa7c4242ba",
      "name": "Tribe Features",
      "user": {
        "_id": "5b1f99a7478dd3768d84b646",
        "profile": {
          "counts": {
            "requests": 2,
            "edits": 46,
            "questionsFollowers": 0,
            "questions": 2,
            "comments": 2,
            "answersWords": 1586,
            "answersVotes": 0,
            "answersViews": 0,
            "answers": 12,
            "views": 0,
            "followings": 3,
            "followers": 3
          },
          "score": 52,
          "externalId": null,
          "verified": true,
          "description": "<p>&nbsp;</p>",
          "title": "Tribe Moderator",
          "picture": "/files/users/646/5b1f99a7478dd3768d84b646_66172.png",
          "website": "",
          "location": "",
          "gender": "male",
          "name": "Siavash Mahmoudian",
          "username": "siavash"
        },
        "id": "5b1f99a7478dd3768d84b646"
      },
      "picture": "/files/topics/2ba/5bb1abe13d9228aa7c4242ba_65172.png",
      "id": "5bb1abe13d9228aa7c4242ba"
    },
    {
      "_id": "5babe5eb3d9228aa7c423c66",
      "name": "Tribe Apps",
      "user": {
        "_id": "5b881b2a90ecbe6751123d7e",
        "profile": {
          "counts": {
            "requests": 2,
            "edits": 148,
            "questionsFollowers": 0,
            "questions": 32,
            "comments": 0,
            "answersWords": 5753,
            "answersVotes": 0,
            "answersViews": 0,
            "answers": 31,
            "views": 0,
            "followings": 1,
            "followers": 2
          },
          "score": 115,
          "externalId": null,
          "verified": false,
          "description": "<p>&nbsp;</p>",
          "title": "Biomedical Engineer ",
          "picture": "/files/users/d7e/5b881b2a90ecbe6751123d7e_57697.png",
          "website": "",
          "location": "",
          "gender": "",
          "name": "Elnaz Najafi",
          "username": "elnajafi89"
        },
        "id": "5b881b2a90ecbe6751123d7e"
      },
      "picture": "/files/topics/c66/5babe5eb3d9228aa7c423c66_66024.png",
      "id": "5babe5eb3d9228aa7c423c66"
    }
  ],
  "aliases": [],
  "id": "5a73b1fcc48071e4c4dc1cae",
  "updateHash": "c7bc3e38df948c7342f9e6b41d817136"
}

This endpoint retrieves portal information.

HTTP Request

GET /api/v1/portal

curl "https://community.tribe.so/api/v1/trends"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let questions = api.portal.trends();

The above command returns JSON structured like this:

{
  "questions": [ ... ],
  "users": [ ... ],
  "topics": [ ... ],
  "answers": [ ... ],
  "events": [ ... ],
  "posts": [ ... ]
}

This endpoint retrieves portal information.

HTTP Request

GET /api/v1/stats/portal

Get Portal Health Stats

curl "https://community.tribe.so/api/v1/stats/portal"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let questions = api.portal.stats();

The above command returns JSON structured like this:

{
  "usersActions": 220,
  "usersPosts": 132,
  "usersSeen": 359,
  "user": {
    "lastSeenAt": "a few seconds ago",
    "lastActionAt": "7 minutes ago",
    "lastPostAt": "7 minutes ago"
  }
}

This endpoint retrieves portal health stats.

HTTP Request

GET /api/v1/stats/portal

Get Portal Leaderboard

curl "https://community.tribe.so/api/v1/stats/users/leaderboard"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let questions = api.portal.leaderboard();

The above command returns JSON structured like this:

[
  {
    "target": {
      "_id": "5b881b2a90ecbe6751123d7e",
      "profile": {
        "counts": {
          "requests": 2,
          "edits": 148,
          "questionsFollowers": 0,
          "questions": 32,
          "comments": 0,
          "answersWords": 5753,
          "answersVotes": 0,
          "answersViews": 0,
          "answers": 31,
          "views": 0,
          "followings": 1,
          "followers": 2
        },
        "score": 115,
        "externalId": null,
        "verified": false,
        "description": "",
        "title": "Biomedical Engineer ",
        "picture": "/files/users/d7e/5b881b2a90ecbe6751123d7e_57697.png",
        "website": "",
        "location": "",
        "gender": "",
        "name": "Elnaz Najafi",
        "username": "elnajafi89"
      },
      "id": "5b881b2a90ecbe6751123d7e",
      "followed": true
    },
    "total": 115
  },
  {
    "target": {
      "_id": "5b7625c6307b5967d06481fb",
      "profile": {
        ...
      }
    },
    "total": 10
  },
  {
    "target": {
      "_id": "5b7de7d02234e67f52e900cf",
      "profile": {
        ...
      }
    },
    "total": 10
  }
]

This endpoint retrieves users leaderboard in portal.

HTTP Request

GET /api/v1/stats/users/leaderboard

Post

Get All Post

curl "https://community.tribe.so/api/v1/posts"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let posts = api.posts.get();

The above command returns JSON structured like this:

[
  {
    "_id": "5c0621864cb2b119dc174a63",
    "shortId": "Px10b",
    "lang": "en",
    "updatedAt": "2018-12-04T06:41:25.370Z",
    "createdAt": "2018-12-04T06:41:10.046Z",
    "title": "This is a test discussion.",
    "content": "<p>Here is the content of the discussion.</p>",
    "portal": "5a73b1fcc48071e4c4dc1cae",
    "publishedAt": "2018-12-04T06:41:10.031Z",
    "user": {
      "_id": "5b1f99a7478dd3768d84b646",
      "profile": {
        "counts": {
          "requests": 2,
          "edits": 46,
          "questionsFollowers": 0,
          "questions": 2,
          "comments": 2,
          "answersWords": 1586,
          "answersVotes": 0,
          "answersViews": 0,
          "answers": 12,
          "views": 0,
          "followings": 3,
          "followers": 3
        },
        "score": 52,
        "externalId": null,
        "verified": true,
        "description": "<p>&nbsp;</p>",
        "title": "Tribe Moderator",
        "picture": "/files/users/646/5b1f99a7478dd3768d84b646_66172.png",
        "website": "",
        "location": "",
        "gender": "male",
        "name": "Siavash Mahmoudian",
        "username": "siavash"
      },
      "id": "5b1f99a7478dd3768d84b646"
    },
    "__v": 2,
    "referrers": [],
    "global": true,
    "downvotes": [],
    "upvotes": [],
    "comments": [],
    "rewards": [],
    "images": [],
    "links": [],
    "media": [],
    "topics": [
      {
        "_id": "5b88264d3d9228aa7c41f692",
        "name": "Tribe",
        "user": {
          "_id": "5b881b2a90ecbe6751123d7e",
          "profile": {
            "counts": {
              "requests": 2,
              "edits": 148,
              "questionsFollowers": 0,
              "questions": 32,
              "comments": 0,
              "answersWords": 5753,
              "answersVotes": 0,
              "answersViews": 0,
              "answers": 31,
              "views": 0,
              "followings": 1,
              "followers": 2
            },
            "score": 115,
            "externalId": null,
            "verified": false,
            "description": "<p>&nbsp;</p>",
            "title": "Biomedical Engineer ",
            "picture": "/files/users/d7e/5b881b2a90ecbe6751123d7e_57697.png",
            "website": "",
            "location": "",
            "gender": "",
            "name": "Elnaz Najafi",
            "username": "elnajafi89"
          },
          "id": "5b881b2a90ecbe6751123d7e"
        },
        "picture": "/files/topics/692/5b88264d3d9228aa7c41f692_72807.png",
        "id": "5b88264d3d9228aa7c41f692"
      }
    ],
    "posters": [
      {
        "user": "5b1f99a7478dd3768d84b646",
        "score": 1,
        "_id": "5c062192f3d2d61a37864a5c"
      }
    ],
    "followers": [],
    "score": 0,
    "counts": {
      "downvotes": 0,
      "links": 0,
      "totalUpvotes": 0,
      "upvotes": 0,
      "followers": 1,
      "users": 1,
      "edits": 0,
      "responses": 1,
      "comments": 0,
      "views": 0
    },
    "status": "published",
    "privacy": "public",
    "type": "discussion",
    "anonymous": false,
    "verified": false,
    "responses": [
      "5c062192f3d2d61a37864a5b"
    ],
    "summary": "Here is the content of the discussion.",
    "id": "5c0621864cb2b119dc174a63",
    "upvoted": false,
    "downvoted": false,
    "followed": false
  }
]

This endpoint retrieves all posts.

HTTP Request

GET /api/v1/posts

Query Parameters

Parameter Default Description
page 1 Intended page
limit 20 Number of items per page
sort createdAt.desc The field to sort on

Get a Specific Post

curl "https://community.tribe.so/api/v1/posts/5c0621864cb2b119dc174a63"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let posts = api.posts.get('5c0621864cb2b119dc174a63');

The above command returns JSON structured like this:

  {
    "_id": "5c0621864cb2b119dc174a63",
    "shortId": "Px10b",
    "lang": "en",
    "updatedAt": "2018-12-04T06:41:25.370Z",
    "createdAt": "2018-12-04T06:41:10.046Z",
    "title": "This is a test discussion.",
    "content": "<p>Here is the content of the discussion.</p>",
    "portal": "5a73b1fcc48071e4c4dc1cae",
    "publishedAt": "2018-12-04T06:41:10.031Z",
    "user": {
      "_id": "5b1f99a7478dd3768d84b646",
      "profile": {
        "counts": {
          "requests": 2,
          "edits": 46,
          "questionsFollowers": 0,
          "questions": 2,
          "comments": 2,
          "answersWords": 1586,
          "answersVotes": 0,
          "answersViews": 0,
          "answers": 12,
          "views": 0,
          "followings": 3,
          "followers": 3
        },
        "score": 52,
        "externalId": null,
        "verified": true,
        "description": "<p>&nbsp;</p>",
        "title": "Tribe Moderator",
        "picture": "/files/users/646/5b1f99a7478dd3768d84b646_66172.png",
        "website": "",
        "location": "",
        "gender": "male",
        "name": "Siavash Mahmoudian",
        "username": "siavash"
      },
      "id": "5b1f99a7478dd3768d84b646"
    },
    "__v": 2,
    "referrers": [],
    "global": true,
    "downvotes": [],
    "upvotes": [],
    "comments": [],
    "rewards": [],
    "images": [],
    "links": [],
    "media": [],
    "topics": [
      {
        "_id": "5b88264d3d9228aa7c41f692",
        "name": "Tribe",
        "user": {
          "_id": "5b881b2a90ecbe6751123d7e",
          "profile": {
            "counts": {
              "requests": 2,
              "edits": 148,
              "questionsFollowers": 0,
              "questions": 32,
              "comments": 0,
              "answersWords": 5753,
              "answersVotes": 0,
              "answersViews": 0,
              "answers": 31,
              "views": 0,
              "followings": 1,
              "followers": 2
            },
            "score": 115,
            "externalId": null,
            "verified": false,
            "description": "<p>&nbsp;</p>",
            "title": "Biomedical Engineer ",
            "picture": "/files/users/d7e/5b881b2a90ecbe6751123d7e_57697.png",
            "website": "",
            "location": "",
            "gender": "",
            "name": "Elnaz Najafi",
            "username": "elnajafi89"
          },
          "id": "5b881b2a90ecbe6751123d7e"
        },
        "picture": "/files/topics/692/5b88264d3d9228aa7c41f692_72807.png",
        "id": "5b88264d3d9228aa7c41f692"
      }
    ],
    "posters": [
      {
        "user": "5b1f99a7478dd3768d84b646",
        "score": 1,
        "_id": "5c062192f3d2d61a37864a5c"
      }
    ],
    "followers": [],
    "score": 0,
    "counts": {
      "downvotes": 0,
      "links": 0,
      "totalUpvotes": 0,
      "upvotes": 0,
      "followers": 1,
      "users": 1,
      "edits": 0,
      "responses": 1,
      "comments": 0,
      "views": 0
    },
    "status": "published",
    "privacy": "public",
    "type": "discussion",
    "anonymous": false,
    "verified": false,
    "responses": [
      "5c062192f3d2d61a37864a5b"
    ],
    "summary": "Here is the content of the discussion.",
    "id": "5c0621864cb2b119dc174a63",
    "upvoted": false,
    "downvoted": false,
    "followed": false
  }

This endpoint retrieves a specific post using ID.

HTTP Request

GET /api/v1/posts/{id}

URL Parameters

Parameter Description
id The ID of the item

Delete a Specific Post

curl "https://community.tribe.so/api/v1/posts/5c0621864cb2b119dc174a63"
  -X DELETE
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let result = api.posts.delete('5c0621864cb2b119dc174a63');

The above command returns JSON structured like this:

{
  "success": true
}

This endpoint deletes a specific post.

HTTP Request

DELETE /api/v1/posts/{id}

URL Parameters

Parameter Description
ID The ID of the post to delete

Get Post's Responses

curl "https://community.tribe.so/api/v1/posts/5c0621864cb2b119dc174a63/responses"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.posts.responses('5c0621864cb2b119dc174a63');

The above command returns JSON structured like this:

[
  {
    "_id": "5c062192f3d2d61a37864a5b",
    "shortId": "PKqoR",
    "lang": "en",
    "updatedAt": "2018-12-04T06:41:22.270Z",
    "createdAt": "2018-12-04T06:41:22.270Z",
    "content": "<p>This is a test response to a discussion.</p>",
    "parent": "5c0621864cb2b119dc174a63",
    "portal": "5a73b1fcc48071e4c4dc1cae",
    "publishedAt": "2018-12-04T06:41:22.262Z",
    "user": {
      "_id": "5b1f99a7478dd3768d84b646",
      "profile": {
        "counts": {
          "requests": 2,
          "edits": 46,
          "questionsFollowers": 0,
          "questions": 2,
          "comments": 2,
          "answersWords": 1586,
          "answersVotes": 0,
          "answersViews": 0,
          "answers": 12,
          "views": 0,
          "followings": 3,
          "followers": 3
        },
        "score": 52,
        "externalId": null,
        "verified": true,
        "description": "<p>&nbsp;</p>",
        "title": "Tribe Moderator",
        "picture": "/files/users/646/5b1f99a7478dd3768d84b646_66172.png",
        "website": "",
        "location": "",
        "gender": "male",
        "name": "Siavash Mahmoudian",
        "username": "siavash"
      },
      "id": "5b1f99a7478dd3768d84b646"
    },
    "__v": 0,
    "referrers": [],
    "global": true,
    "downvotes": [],
    "upvotes": [],
    "comments": [],
    "rewards": [],
    "images": [],
    "links": [],
    "media": [],
    "topics": [],
    "posters": [],
    "followers": [],
    "score": 0,
    "counts": {
      "downvotes": 0,
      "links": 0,
      "totalUpvotes": 0,
      "upvotes": 0,
      "followers": 1,
      "users": 1,
      "edits": 0,
      "responses": 0,
      "comments": 0,
      "views": 0
    },
    "status": "published",
    "privacy": "public",
    "type": "response",
    "anonymous": false,
    "verified": false,
    "responses": [],
    "summary": "This is a test response to a discussion.",
    "id": "5c062192f3d2d61a37864a5b",
    "upvoted": false,
    "downvoted": false,
    "followed": false
  }
]

HTTP Request

GET /api/v1/posts/{id}/responses

URL Parameters

Parameter Description
id The ID of the question

Query Parameters

Parameter Default Description
page 1 Intended page
limit 20 Number of items per page
sort createdAt.desc The field to sort on

Questions

Get All Questions

curl "https://community.tribe.so/api/v1/questions"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let questions = api.questions.get();

The above command returns JSON structured like this:

[
  {
    "_id": "5a816275f8030b3bdd655b0d",
    "updatedAt": "2018-02-12T19:07:21.136Z",
    "createdAt": "2018-02-12T09:46:29.646Z",
    "title": "What is a perfect life?",
    "lastAskedAt": "2018-02-12T09:46:29.642Z",
    "__v": 0,
    "lastAnsweredAt": "2018-02-12T19:07:21.135Z",
    "downvotes": [],
    "upvotes": [],
    "followers": [],
    "askers": [],
    "comments": [],
    "topics": [],
    "score": 0,
    "counts": {
      "asks": 1,
      "downvotes": 0,
      "upvotes": 0,
      "edits": 2,
      "comments": 0,
      "hiddenAnswers": 0,
      "answers": 2,
      "views": 8,
      "followers": 0
    },
    "type": "general",
    "anonymous": true,
    "verified": false,
    "locked": false,
    "followed": false
  }
]

This endpoint retrieves all questions.

HTTP Request

GET /api/v1/questions

Query Parameters

Parameter Default Description
page 1 Intended page
limit 20 Number of items per page
sort createdAt.desc The field to sort on

Get a Specific Question

curl "https://community.tribe.so/api/v1/questions/5a816275f8030b3bdd655b0d"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let questions = api.questions.get('5a816275f8030b3bdd655b0d');

The above command returns JSON structured like this:

{
  "_id": "5a816275f8030b3bdd655b0d",
  "updatedAt": "2018-02-12T19:07:21.136Z",
  "createdAt": "2018-02-12T09:46:29.646Z",
  "title": "What is a perfect life?",
  "lastAskedAt": "2018-02-12T09:46:29.642Z",
  "__v": 0,
  "lastAnsweredAt": "2018-02-12T19:07:21.135Z",
  "downvotes": [],
  "upvotes": [],
  "followers": [],
  "askers": [],
  "comments": [],
  "topics": [],
  "score": 0,
  "counts": {
    "asks": 1,
    "downvotes": 0,
    "upvotes": 0,
    "edits": 2,
    "comments": 0,
    "hiddenAnswers": 0,
    "answers": 2,
    "views": 8,
    "followers": 0
  },
  "type": "general",
  "anonymous": true,
  "verified": false,
  "locked": false,
  "followed": false
}

This endpoint retrieves a specific question using ID.

HTTP Request

GET /api/v1/questions/{id}

URL Parameters

Parameter Description
id The ID of the item

Delete a Specific Question

curl "https://community.tribe.so/api/v1/questions/5a816275f8030b3bdd655b0d"
  -X DELETE
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let result = api.questions.delete('5a816275f8030b3bdd655b0d');

The above command returns JSON structured like this:

{
  "success": true
}

This endpoint deletes a specific question.

HTTP Request

DELETE /api/v1/questions/{id}

URL Parameters

Parameter Description
ID The ID of the question to delete

Get Question's Answers

curl "https://community.tribe.so/api/v1/questions/5a816275f8030b3bdd655b0d/answers"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.questions.answers('5a816275f8030b3bdd655b0d');

HTTP Request

GET /api/v1/questions/{id}/answers

URL Parameters

Parameter Description
id The ID of the question

Query Parameters

Parameter Default Description
page 1 Intended page
limit 20 Number of items per page
sort createdAt.desc The field to sort on

Get Question's Experts

curl "https://community.tribe.so/api/v1/questions/5a816275f8030b3bdd655b0d/experts"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.questions.experts('5a816275f8030b3bdd655b0d');

HTTP Request

GET /api/v1/questions/{id}/experts

URL Parameters

Parameter Description
id The ID of the question

Get Question Recommendations

curl "https://community.tribe.so/api/v1/questions/5a816275f8030b3bdd655b0d/recommendations"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.questions.recommendations('5a816275f8030b3bdd655b0d');

HTTP Request

GET /api/v1/questions/{id}/recommendations

URL Parameters

Parameter Description
id The ID of the question

Get Similar Questions

curl "https://community.tribe.so/api/v1/questions/similars"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.questions.similars('This is a test question title');

This endpoint find related questions to keywords or a question title.

HTTP Request

GET /api/v1/questions/similars

Query Parameters

Parameter Default Description
questy "" Keywords or title of a question

Create a Questions

curl "https://community.tribe.so/api/v1/questions"
  -X POST
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let question = api.questions.create({ title: 'What is life?'});

This endpoint creates a question.

HTTP Request

POST /api/v1/questions

Topics

Get All Topics

curl "https://community.tribe.so/api/v1/topics"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let topics = api.topics.get();

The above command returns JSON structured like this:

[
  {
    "_id": "5b88264d3d9228aa7c41f692",
    "name": "Tribe",
    "portal": "5a73b1fcc48071e4c4dc1cae",
    "updatedAt": "2018-11-29T06:16:08.223Z",
    "__v": 8,
    "createdAt": "2018-08-30T17:15:57.884Z",
    "aliases": [],
    "children": [
      "5bb1abe13d9228aa7c4242ba",
      "5babb4603d9228aa7c423c23",
      "5bbf7b083d9228aa7c427450",
      "5babe5eb3d9228aa7c423c66"
    ],
    "counts": {
      "questions": 55,
      "followers": 3,
      "subquestions": 79,
      "children": 4
    },
    "definitions": [],
    "paths": [
      [
        {
          "_id": "5b88264d3d9228aa7c41f692",
          "name": "Tribe",
          "picture": "/files/topics/692/5b88264d3d9228aa7c41f692_72807.png"
        }
      ]
    ],
    "shortId": "5oqoy",
    "user": "5b881b2a90ecbe6751123d7e",
    "picture": "/files/topics/692/5b88264d3d9228aa7c41f692_72807.png",
    "experts": {
      "5b881b2a90ecbe6751123d7e": 24,
      "5b3f7fe0d5a11b6297259cab": 16,
      "5b1f99a7478dd3768d84b646": 12,
      "5b913111f19a473232026877": 3,
      "5ba95b5c630b876a1e9785a5": 1
    },
    "about": "",
    "followed": true
  }
]

This endpoint retrieves all topics.

HTTP Request

GET /api/v1/topics

Query Parameters

Parameter Default Description
page 1 Intended page
limit 20 Number of items per page
sort createdAt.desc The field to sort on

Get a Specific Topic

curl "https://community.tribe.so/api/v1/topics/5b88264d3d9228aa7c41f692"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let topics = api.topics.get('5b88264d3d9228aa7c41f692');

The above command returns JSON structured like this:

{
  "_id": "5b88264d3d9228aa7c41f692",
  "name": "Tribe",
  "portal": "5a73b1fcc48071e4c4dc1cae",
  "updatedAt": "2018-11-29T06:16:08.223Z",
  "__v": 8,
  "createdAt": "2018-08-30T17:15:57.884Z",
  "aliases": [],
  "children": [
    "5bb1abe13d9228aa7c4242ba",
    "5babb4603d9228aa7c423c23",
    "5bbf7b083d9228aa7c427450",
    "5babe5eb3d9228aa7c423c66"
  ],
  "counts": {
    "questions": 55,
    "followers": 3,
    "subquestions": 79,
    "children": 4
  },
  "definitions": [],
  "paths": [
    [
      {
        "_id": "5b88264d3d9228aa7c41f692",
        "name": "Tribe",
        "picture": "/files/topics/692/5b88264d3d9228aa7c41f692_72807.png"
      }
    ]
  ],
  "shortId": "5oqoy",
  "user": "5b881b2a90ecbe6751123d7e",
  "picture": "/files/topics/692/5b88264d3d9228aa7c41f692_72807.png",
  "experts": {
    "5b881b2a90ecbe6751123d7e": 24,
    "5b3f7fe0d5a11b6297259cab": 16,
    "5b1f99a7478dd3768d84b646": 12,
    "5b913111f19a473232026877": 3,
    "5ba95b5c630b876a1e9785a5": 1
  },
  "about": "",
  "followed": true
}

This endpoint retrieves a specific topic using ID.

HTTP Request

GET /api/v1/topics/{id}

URL Parameters

Parameter Description
id The ID of the item

Create a Topic

curl "https://community.tribe.so/api/v1/topics/5b88264d3d9228aa7c41f692"
  -X POST
  -H "Authorization: Bearer {access_token}"
  -H 'Content-Type: application/json; charset=utf-8' \
  --DATA '{"name":"Test Topic"}'
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let result = api.topics.create({name: 'Test Topic'});

The above command returns JSON structured like this:

{
  "_id": "5b88264d3d9228aa7c41f693",
  "name": "Test Topic",
  "portal": "5a73b1fcc48071e4c4dc1cae",
  "updatedAt": "2018-11-29T06:16:08.223Z",
  "__v": 8,
  "createdAt": "2018-08-30T17:15:57.884Z",
  "aliases": [],
  "children": [],
  "counts": {
    "questions": 0,
    "followers": 0,
    "subquestions": 0,
    "children": 0
  },
  "definitions": [],
  "paths": [],
  "shortId": "5oqoy",
  "user": "5b881b2a90ecbe6751123d7e",
  "experts": {},
  "about": "",
  "followed": false
}

This endpoint creates a new topic.

HTTP Request

POST /api/v1/topics

Request Parameters

Parameter Default Description
name null The name of the Topic
about null The description of the Topic
picture null Url to a picture for this Topic
definitions [] The different types assigned with the Topic. It can be an array of following: ['Concept', 'Location', 'Localizable','Activity', 'QuestionType', 'Category', 'Event', 'Person', 'AcademicField', 'Job', 'Person', 'Company', 'School', 'Product', 'Adult']
aliases [] An array of Aliases for this Topic. Aliases help users search the Topic with different keywords.
externalId null The unique ID of the Topic in an external platform. This is useful when creating a Topic for an external entity.

Delete a Specific Topic

curl "https://community.tribe.so/api/v1/topics/5b88264d3d9228aa7c41f692"
  -X DELETE
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let result = api.topics.delete('5b88264d3d9228aa7c41f692');

The above command returns JSON structured like this:

{
  "success": true
}

This endpoint deletes a specific topic.

HTTP Request

DELETE /api/v1/topics/{id}

URL Parameters

Parameter Description
ID The ID of the topic to delete

Get Topic's Questions

curl "https://community.tribe.so/api/v1/topics/5b88264d3d9228aa7c41f692/questions"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.topics.questions('5b88264d3d9228aa7c41f692');

HTTP Request

GET /api/v1/topics/{id}/questions

URL Parameters

Parameter Description
id The ID of the topic

Get Topic's Experts

curl "https://community.tribe.so/api/v1/topics/5b88264d3d9228aa7c41f692/experts"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.topics.experts('5b88264d3d9228aa7c41f692');

HTTP Request

GET /api/v1/topics/{id}/experts

URL Parameters

Parameter Description
id The ID of the topic

Users

Get All Users

curl "https://community.tribe.so/api/v1/users"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.users.get();

The above command returns JSON structured like this:

[
  {
    "_id": "5b1f99a7478dd3768d84b646",
    "profile": {
      "counts": {
        "requests": 2,
        "edits": 46,
        "questionsFollowers": 0,
        "questions": 2,
        "comments": 2,
        "answersWords": 1586,
        "answersVotes": 0,
        "answersViews": 0,
        "answers": 12,
        "views": 0,
        "followings": 3,
        "followers": 3
      },
      "score": 52,
      "externalId": null,
      "verified": true,
      "description": "",
      "title": "Tribe Moderator",
      "picture": "",
      "website": "",
      "location": "",
      "gender": "male",
      "name": "John Smith",
      "username": "john"
    },
    "id": "5b1f99a7478dd3768d84b646",
    "followed": false
  }
]

This endpoint retrieves all users.

HTTP Request

GET /api/v1/users

Query Parameters

Parameter Default Description
page 1 Intended page
limit 20 Number of items per page
sort createdAt.desc The field to sort on

Get a Specific User

curl "https://community.tribe.so/api/v1/users/5b1f99a7478dd3768d84b646"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.users.get('5b1f99a7478dd3768d84b646');

The above command returns JSON structured like this:

{
  "_id": "5b1f99a7478dd3768d84b646",
  "profile": {
    "counts": {
      "requests": 2,
      "edits": 46,
      "questionsFollowers": 0,
      "questions": 2,
      "comments": 2,
      "answersWords": 1586,
      "answersVotes": 0,
      "answersViews": 0,
      "answers": 12,
      "views": 0,
      "followings": 3,
      "followers": 3
    },
    "score": 52,
    "externalId": null,
    "verified": true,
    "description": "",
    "title": "Tribe Moderator",
    "picture": "",
    "website": "",
    "location": "",
    "gender": "male",
    "name": "John Smith",
    "username": "john"
  },
  "id": "5b1f99a7478dd3768d84b646",
  "followed": false
}

This endpoint retrieves a specific user using ID.

HTTP Request

GET /api/v1/users/{id}

URL Parameters

Parameter Description
id The ID of the user

Delete a Specific User

curl "https://community.tribe.so/api/v1/users/5b1f99a7478dd3768d84b646"
  -X DELETE
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let result = api.users.delete('5b1f99a7478dd3768d84b646');

The above command returns JSON structured like this:

{
  "success": true
}

This endpoint deletes a specific user.

HTTP Request

DELETE /api/v1/users/{id}

URL Parameters

Parameter Description
ID The ID of the user to delete

Get User's Followers

curl "https://community.tribe.so/api/v1/users/5b1f99a7478dd3768d84b646/followers"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.users.followers('5b1f99a7478dd3768d84b646');

The above command returns JSON structured like this:

[
  {
    "_id": "5b3f7fe0d5a11b6297259cab",
    "profile": {
      "counts": {
        "requests": 2,
        "edits": 46,
        "questionsFollowers": 0,
        "questions": 4,
        "comments": 0,
        "answersWords": 1128,
        "answersVotes": 0,
        "answersViews": 0,
        "answers": 8,
        "views": 0,
        "followings": 1,
        "followers": 2
      },
      "score": 58,
      "externalId": null,
      "verified": true,
      "description": "<p>&nbsp;</p>",
      "title": "Community Moderator at Tribe",
      "picture": "/files/users/cab/5b3f7fe0d5a11b6297259cab_57983.png",
      "website": "",
      "location": "",
      "gender": "",
      "name": "Mike Modiri",
      "username": "mike"
    },
    "id": "5b3f7fe0d5a11b6297259cab",
    "followed": false
  }
]

This endpoint retrieves a specific user's followers using ID.

HTTP Request

GET /api/v1/users/{id}/followers

URL Parameters

Parameter Description
id The ID of the user

Get User's Following

curl "https://community.tribe.so/api/v1/users/5b1f99a7478dd3768d84b646/followings"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.users.following('5b1f99a7478dd3768d84b646');

The above command returns JSON structured like this:

[
  {
    "_id": "5b3f7fe0d5a11b6297259cab",
    "profile": {
      "counts": {
        "requests": 2,
        "edits": 46,
        "questionsFollowers": 0,
        "questions": 4,
        "comments": 0,
        "answersWords": 1128,
        "answersVotes": 0,
        "answersViews": 0,
        "answers": 8,
        "views": 0,
        "followings": 1,
        "followers": 2
      },
      "score": 58,
      "externalId": null,
      "verified": true,
      "description": "<p>&nbsp;</p>",
      "title": "Community Moderator at Tribe",
      "picture": "/files/users/cab/5b3f7fe0d5a11b6297259cab_57983.png",
      "website": "",
      "location": "",
      "gender": "",
      "name": "Mike Modiri",
      "username": "mike"
    },
    "id": "5b3f7fe0d5a11b6297259cab",
    "followed": false
  }
]

This endpoint retrieves a specific user's followings using ID.

HTTP Request

GET /api/v1/users/{id}/followings

URL Parameters

Parameter Description
id The ID of the user

Get User's Expertise

curl "https://community.tribe.so/api/v1/users/5b1f99a7478dd3768d84b646/expertise"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.users.expertise('5b1f99a7478dd3768d84b646');

The above command returns JSON structured like this:

[
  {
    "topic": {
      "_id": "5b88264d3d9228aa7c41f692",
      "name": "Tribe",
      "portal": "5a73b1fcc48071e4c4dc1cae",
      "updatedAt": "2018-12-04T06:41:25.365Z",
      "__v": 8,
      "createdAt": "2018-08-30T17:15:57.884Z",
      "shortId": "5oqoy",
      "picture": "/files/topics/692/5b88264d3d9228aa7c41f692_72807.png",
      "experts": {
        "5ba95b5c630b876a1e9785a5": 1,
        "5b913111f19a473232026877": 3,
        "5b1f99a7478dd3768d84b646": 12,
        "5b3f7fe0d5a11b6297259cab": 16,
        "5b881b2a90ecbe6751123d7e": 24
      },
      "about": "<p>&nbsp;</p>",
      "counts": {
        "children": 4,
        "edits": 0,
        "posts": 1,
        "subquestions": 79,
        "questions": 55,
        "subanswers": 0,
        "answers": 0,
        "views": 0,
        "followers": 3
      },
      "paths": [
        [
          {
            "picture": "/files/topics/692/5b88264d3d9228aa7c41f692_72807.png",
            "name": "Tribe",
            "_id": "5b88264d3d9228aa7c41f692"
          }
        ]
      ],
      "id": "5b88264d3d9228aa7c41f692",
      "followed": true
    },
    "score": 12
  },
  {
    "topic": {
      ...
    },
    "score": 5
  },
  {
    "topic": {
      ...
    },
    "score": 2
  },
  {
    "topic": {
      ...
    },
    "score": 1
  }
]

This endpoint retrieves a specific user's expertise using ID.

HTTP Request

GET /api/v1/users/{id}/expertise

URL Parameters

Parameter Description
id The ID of the user

Get User's Questions

curl "https://community.tribe.so/api/v1/users/5b1f99a7478dd3768d84b646/questions"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.users.questions('5b1f99a7478dd3768d84b646');

HTTP Request

GET /api/v1/users/{id}/questions

URL Parameters

Parameter Description
id The ID of the user

Get User's Answers

curl "https://community.tribe.so/api/v1/users/5b1f99a7478dd3768d84b646/answers"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.users.answers('5b1f99a7478dd3768d84b646');

HTTP Request

GET /api/v1/users/{id}/answers

URL Parameters

Parameter Description
id The ID of the user

Errors

The Tribe API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- The requested item is hidden for administrators only.
404 Not Found -- The requested item could not be found.
405 Method Not Allowed -- You tried to access an endpoint with an invalid method.
410 Gone -- The item requested has been removed from our servers.
429 Too Many Requests -- You're sending too many requests!
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.

Widgets

Getting Started

Tribe widgets are components from community which you can easily embed in your product, website, or service.

Using Tribe widgets is super simple. Start by pasting following script in your website's <head> tag.

<!-- Tribe Tag -->
<script>
  (function(t,r,i,b,e){
    if(typeof t.Tribe==='function'){t.Tribe('reload',{portal:i});}
    else{b=function(){b.r(arguments);};b.q=[];b.r=function(args){b.q.push(args);};
    t.Tribe=b; e=r.createElement('script');e.type='text/javascript';e.async=true;
    e.src=i+'/widget/v1/main.js?t='+Math.ceil(new Date() / 3e5) * 3e5;
    var x=r.getElementsByTagName('script')[0];x.parentNode.insertBefore(e,x);
    t.Tribe('boot',{portal:i});}
  })(window,document,'{YourCommunityAddress}');
</script>

Make sure to replace {YourCommunityAddress} with the root address to your community, including https://. For instance if your community url is https://community.tribe.so, the script should look like this:

<!-- Tribe Tag -->
<script>
  (function(t,r,i,b,e){
    if(typeof t.Tribe==='function'){t.Tribe('reload',{portal:i});}
    else{b=function(){b.r(arguments);};b.q=[];b.r=function(args){b.q.push(args);};
    t.Tribe=b; e=r.createElement('script');e.type='text/javascript';e.async=true;
    e.src=i+'/widget/v1/main.js?t='+Math.ceil(new Date() / 3e5) * 3e5;
    var x=r.getElementsByTagName('script')[0];x.parentNode.insertBefore(e,x);
    t.Tribe('boot',{portal:i});}
  })(window,document,'https://community.tribe.so');
</script>

After the script is in place you can use window.Tribe function to add widgets to your website.

window.Tribe accepts one or two arguments. The first argument is the widget type or action that you want to perform, and the second argument is an object which defines widget's options.

<script>
  window.Tribe('widgetType', {id: 'test'})
</script>

Form Widget

Using form widgets you can display community signup or login form in your website. Since this widget injects HTML into your page it'll automatically adapts look and feel of your webpage. You can additionaly customize it using your website's CSS.

<div id="signup-form"></div>
<script>
  window.Tribe('form', {
    id: 'signup-form', 
    type: 'signup'
  })
</script>

The script above results in a form like this:

Signup widget

Widget Options

OptionDefaultDescription
id null The ID of the div to append the widget
type signup The type of the form. Can be signup or login.
labels {
email: 'Email',
password: 'Password',
name: 'Name'
}
The form labels for each field.
fields ['name', 'email', 'password'] Defines the order and visibility of fields.
redirect null Where to go after the form is submitted successfully.

Questions Widget

Using questions widget you can embed a feed of questions around certain topic(s) right into your website. Visitors can ask new questions, follow them and find answers to the questions.

Using components option you're able to define which items should be visible inside the widget. For instance you can display or hide the breadcrumb, topic header, sidebar, question input, etc.

<div id="questions-widget"></div>
<script>
  window.Tribe('questions', {
    topicId: '5babe5eb3d9228aa7c423c66', 
    id: 'questions-widget', 
    components: ['input']
  })
</script>

The script above results in the following widget:

Questions widget

Widget Options

OptionDefaultDescription
id null The ID of the div to append the widget.
topicId null The widget will show only questions with the defined topic ID.
components [
'breadcrumb', 'sidebar',
'header', 'input',
'suggestions'
]
Defines which elements should be displayed in the widget.
fields ['name', 'email', 'password'] Defines the order and visibility of fields.
redirect null Where to go after the form is submitted successfully.

Custom Widgets

In many cases, Tribe builds a very custom widget which suites your company's needs. Tribe provides a widget ID to your company and you can insert the widget using following script:

<div id="custom-widget"></div>
<script>
  window.Tribe('widget', {
    id: 'custom-widget', 
    widgetId: '<Custom Widgets ID>',
    optionA: valueA,
    optionB: valueB
  })
</script>

Please note that optionA and optionB are sample names. Each custom widget has different sets of options. Tribe team email you a detailed instruction about your custom widget which includes all available options.

User Authentication

In Tribe, there are three different authentication methods available for widgets.

Session

If you don't have a separate userbase or want Tribe to handle authentication this is the right authentication method.

The widget will check Tribe Community to see if the user is logged in there. If they are not, we'll show a Signup/Login button inside the widgets.

User can click on the button and login in a new window. The platform will return user to the previous page after user is logged in.

JWT (JSON Web Token)

In this method you'll sign a JSON token with User's information using a private key and pass it as an option to the widget.

You should login to your community as an Admin and go to Single Sign-On section under Admin Panel to access your private key. In the Single Sign-On section you can find examples on how to generate the JWT in Node.js, PHP, Java, Python and Ruby programming languages.

You can use JWT to pass widget-specific data as well.

Here is how a Question Widget script looks like with JWT:

<div id="questions-widget"></div>
<script>
  window.Tribe('questions', {
    topicId: '5babe5eb3d9228aa7c423c66', 
    id: 'questions-widget', 
    components: ['input'],
    jwt: '<The JWT generated in backend goes here>'
  })
</script>

OAuth2

To enable OAuth2 on your widgets you need to create an OAuth2 app for Tribe on your side and email us the following information to dev@tribe.so:

We will setup the OAuth2 Single Sign-On for your community on our side. Any time a user accesses a widget which needs authentication, we'll redirect user to the authorization URL. If user is already logged in on your application, they'll get logged in right away. Otherwise, they'll see your login screen and will be redirected to the widget after they're signed in.