NAV
cURL javascript

Introduction

Welcome to the SelfCommunity Developers documentation!

You'll find comprehensive documentation to work with SelfCommunity API and Webhooks.

The SelfCommunity API and Webhooks are only available to Enterprise plan subscribers. Find out more about the available SelfCommunity plans.

API

As an Enterprise plan subscriber, login to https://make.selfcommunity.com with your account, go to the API section on Integration menu and enable the API and the Authentication.

Continue reading this documentation to learn how to use SelfCommunity APIs.

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

Intro

Selfcommunity supports two types of authentication methods:

Both methods are suitable for different scenarios (Authorization, Information Exchange, etc.).

Depending on the type of interaction with the community APIs, it might be more convenient to use one method rather than another. If access to APIs communities occurs only on server side, we recommend using JWT authentication. In all other cases, for security reasons, use OAuth 2.0 authentication.

JWT Token

Example of a JWT Access Token

eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.
eyJleHAiOjE2MDI0OTYwMjksInVzZXJfaWQiOjcsImlhdCI6MTYwMjQ5NDIyOX0.
v9H5nkbu_J0ysGqY2YUeufn1ypHmvvTc2k2WoDdztvw

JSON Web Token (JWT) is an open standard RFC 7519 that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. This information can be verified and trusted because it is digitally signed.

JWTs will be signed using a shared secret (with the HMAC algorithm). If your product support JWT access token, go to Community APIs panel under Integration menu on https://make.selfcommunity.com. You need to first check that you have enabled the Community APIs and Authentication APIs and retrieve the secret key in the JWT Authentication panel.

If you want to learn more about JWTs, we recommend the full documentation at jwt.io.

JSON Web Tokens are strings of text which are passed on every request (Header Authorization) to access protected resources of the server. They contain a combination of secrets from the API and payload data in the form of a JSON object.

Generating JWTs

A single JWT consists of three components: Header, Payload, and Signature with a . separating each.

For example, a JWT typically looks like the following:

aaaaa.bbbbb.ccccc

The SelfCommunity API recommends and supports libraries provided on jwt.io. While other libraries can create JWT, these recommended libraries are the most robust.

Below we see how to generate the three components of a jwt.

Header

Header of a JWT Token

{
  "alg": "HS256",
  "typ": "JWT"
}

The Header includes the specification of the signing algorithm and type of token.

Then, this JSON is Base64Url encoded to form the first part of the JWT.

Payload

The payload of a token contains the claims or the pieces of information being passed about the user and any metadata required. While there are three types of claims, registered, public, and private, we highly recommend using registered claims for interoperability.

Payload of a JWT Token

{
  "user_id": 1,
  "token_type": "access",
  "jti": "random unique identifier of the token",
  "iat": 1496091964000,
  "exp": 1496091964200
}

A payload require an user id (user_id), an expiration time (exp), an issued at a time (iat) and a JWT ID (jti). The ext_id is not necessary in order to authenticate the user. It is included if the token is generated by the community itself. It will not be verified in the authorization phase.

In particular:

It is highly recommended to set the exp timestamp for a short period, i.e. a few minutes, a few hours. This way, if a token is intercepted or shared, the token will only be valid for a short period of time.

Signature

Signature of a JWT Token

HMACSHA256(
    base64UrlEncode(header) + "." +
    base64UrlEncode(payload),
    SECRET_KEY)

The Signature of the token base64 encodes the header and payload, then includes the API Secret within the HMACSHA256 algorithm to securely sign the entire package.

The signature is used to verify the message wasn't changed along the way and it can also verify that the sender of the JWT is who it says it is.

Putting all together

// Example of how to create a JWT token using jsonwebtoken library.
// If jsonwebtoken is not installed, instal with: npm install --save jsonwebtoken
// To generate the token, use this code:

var jwt = require("jsonwebtoken");
var SECRET_KEY = "f848a99779fe4b7bd2df67adcffde35ab6f4741eba8e3123"; // Your SECRET_KEY

function createToken(user) {
  var userData = {
    "user_id": 1, // or an other regisered user_id
    "token_type": "access",
    "jti": new Date().getTime() // or use another method
  };
  return jwt.sign(userData, SECRET_KEY, {
    algorithm: "HS256",
    expiresIn: "1h", // or choose another expiration time
    header: { typ: "JWT" }
  });
}

The output is three Base64-URL strings separated by dots that can be easily passed in the Authorization header.

<header>.<payload>.<signature>

Take a look at the example in the javascript code tab.

Code samples

To authorize, use this code:

# With shell, you can just pass the correct header with each request
curl "api_endpoint_here"
  -H "Authorization: Bearer <token>"

Make sure to replace <token> with your JWT access token.
// To authorize the request, use this code:

const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer '.concat(token)
};

fetch('<api_endpoint_here>',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

Whenever the user wants to access a protected route or resource, the user agent should send the JWT, typically in the Authorization header using the Bearer schema.

The content of the header should look like the following:

Authorization: Bearer <token>

This can be, in certain cases, a stateless authorization mechanism. The server's protected routes will check for a valid JWT in the Authorization header, and if it's present, the user will be allowed to access protected resources. If the JWT contains the necessary data, the need to query the database for certain operations may be reduced, though this may not always be the case.

Verify JWTs

Code samples

# You can also use wget
curl -X POST /api/v2/jwt/verify_token/ \
  -H 'Accept: application/json'
  -H 'Content-Type: application/json; charset=utf-8'
  --DATA '{"token": "<token>"}'

const headers = {
  'Accept':'application/json'
};

const inputBody = {
    'token': '<token>'
};

fetch('/api/v2/jwt/verify_token/',
{
  method: 'GET',
  headers: headers,
  body: inputBody
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This Endpoint test the validity of the token. It verifies the JWS (Signature) of the token.

Note: It does not verify the user_id, ext_id and the token_type of the payload.

HTTP Request

GET /api/v2/jwt/verify_token/

Responses

Status Meaning Description Schema
200 OK Token is valid none
401 Unauthorized Token is not valid none

OAuth 2.0

To allow applications to manage individual user data, the Community provides direct support to OAuth2.0, the industry-standard authorization protocol that allows applications to obtain requested access to user accounts over HTTP.

OAuth apps are typically end-user applications which allow secure integration with Community APIs to access authorized data for each user. As a developer, you can use OAuth to allow access to users’ information related to their Community accounts, upon granting permission.

OAuth apps can either be installed and managed across an account by account admins as an account-level app or by end-users individually as a user-managed app.

Create an OAuth 2.0 App

Register Your App

To register your app, visit the https://make.selfcommunity.com and click on the Community Apis option under Integrations in the left menu. Enable Community Apis and Authentcation api if they are disabled.

Go to OAuth 2.0 subpanel and click on 'ADD NEW APP'.

Select Client Type

The first thing you are asked to specify when you want to create an oauth2 app is the Client Type.

The OAuth 2.0 framework specifies several grant types for different use cases. – Grant types

In OAuth 2.0, the term “grant type” refers to the way an application gets an access token. OAuth 2.0 defines several grant types and each grant type is designed for a particular use case, whether that’s a web app, a mobile or desktop app, or server-to-server applications. Community Authentication supports three types of grants:

Authorization Code

The Authorization Code grant type is used by confidential and public clients to exchange an authorization code for an access token. After the user returns to the client via the redirect URL, the application will get the authorization code from the URL and use it to request an access token.

Implicit

The Implicit flow was a simplified OAuth flow previously recommended for native apps and JavaScript apps where the access token was returned immediately without an extra authorization code exchange step. It is not recommended to use the implicit flow (and some servers prohibit this flow entirely) due to the inherent risks of returning access tokens in an HTTP redirect without any confirmation that it has been received by the client. Public clients such as native apps and JavaScript apps should now use the authorization code flow.

Password

The Password grant type is a way to exchange a user's credentials for an access token. Because the client application has to collect the user's password and send it to the authorization server, it is not recommended that this grant be used at all anymore. This flow provides no mechanism for things like multifactor authentication or delegated accounts, so is quite limiting in practice.

Enter basic app information

Provide app related information and get client credentials The windows that follow will ask you to provide a series of information.

Only the application name is required unless otherwise noted. Descriptions of each field are provided below:

Set Redirect URIs (not required if app grant type is password)

Redirect URIs are a critical part of the OAuth flow. After a user successfully authorizes an application, the authorization server will redirect the user back to the application with either an authorization code or access token in the URL. Because the redirect URL will contain sensitive information, it is critical that the service doesn’t redirect the user to arbitrary locations.

The best way to ensure the user will only be directed to appropriate locations is to require to register one or more redirect URLs when they create the application.

Redirect URIs are required only for client of grant type authorization-flow. You can enter a list of URIs, space separated. Redirect URIs determines where the API server redirects the user after the user completes the authorization flow. The value must exactly match one of the authorized redirect URIs for the OAuth 2.0 client, which you configured in your app. If this value doesn't match an authorized redirect URI for the provided client_id you will get a redirect_uri_mismatch error.

Submission

After you provide the information mentioned above, app credentials (Client ID/Secret Key) will be automatically generated for your app.

Testing OAuth 2.0 App

Getting an Access Token

Depending on the type of client type for there are different ways to get a token.

For the following examples let's assume we have created an app with the following credentials:

Authorization Code

To start the Authorization code flow got to this URL with is the same as show bellow:

https://<community_hostname>/oauth/authorize/?response_type=code&client_id=vW1RcAl7Mb0d5gyHNQIAcH110lWoOW2BmWJIero8&redirect_uri=https://127.0.0.1:8000/callback

https://<community_hostname>/oauth/authorize/?response_type=code&client_id=vW1RcAl7Mb0d5gyHNQIAcH110lWoOW2BmWJIero8&redirect_uri=https://127.0.0.1:8000/callback

Note the parameters we pass:

This identifies the application, the user is asked to authorize your application to access its resources.

Remenber we used https://127.0.0.1:8000/callback as redirect_uri you will get a Page not found (404) but it worked if you get a url like:

https://127.0.0.1:8000/callback?code=uVqLxiHDKIirldDZQfSnDsmYW1Abj2

This is the OAuth2 provider trying to give you a code, in this case uVqLxiHDKIirldDZQfSnDsmYW1Abj2.

curl -X POST
    -H "Cache-Control: no-cache"
    -H "Content-Type: application/x-www-form-urlencoded"
    "https://<community_hostname>/oauth/token/"
    -d "client_id=${ID}"
    -d "client_secret=${SECRET}"
    -d "code=${CODE}"
    -d "redirect_uri=https://127.0.0.1:8000/callback"
    -d "grant_type=authorization_code"

Now that you have the user authorization is time to get an access token:

curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" "https://<community_hostname>/oauth/token/" -d "client_id=${ID}" -d "client_secret=${SECRET}" -d "code=${CODE}" -d "redirect_uri=https://127.0.0.1:8000/callback" -d "grant_type=authorization_code"

The OAuth2 provider will return the follow response:

{
  "access_token": "jooqrnOrNa0BrNWlg68u9sl6SkdFZg",
  "expires_in": 36000,
  "token_type": "Bearer",
  "scope": "read write",
  "refresh_token": "HNvDQjjsnvDySaK0miwG4lttJEl9yD"
}

{ "access_token": "jooqrnOrNa0BrNWlg68u9sl6SkdFZg", "expires_in": 36000, "token_type": "Bearer", "scope": "read write", "refresh_token": "HNvDQjjsnvDySaK0miwG4lttJEl9yD" }

To access the user resources we just use the access_token.

Set the HTTP Authorization header as Bearer to access the protected resources as in the example below:

curl -H "Authorization: Bearer jooqrnOrNa0BrNWlg68u9sl6SkdFZg" -X GET https://<community_hostname>/api/v2/<resource>

Implicit

https://<community_hostname>/oauth/authorize?client_id=vW1RcAl7Mb0d5gyHNQIAcH110lWoOW2BmWJIero8&redirect_uri=https://127.0.0.1:8000/callback&response_type=token

To start the Implicit flow got to this URL with is the same as show below:

https://<community_hostname>/oauth/authorize?client_id=vW1RcAl7Mb0d5gyHNQIAcH110lWoOW2BmWJIero8&redirect_uri=https://127.0.0.1:8000/callback&response_type=token

This identifies the application, the user is asked to authorize your application to access its resources as in the authorize-code flow. After the user has granted the authorization, the server responds with a redirect to redirect_uri. The only difference, respect to the authorization-code flow, is that in this case the access token will appear in the url fragment of the redirect_uri.

https://127.0.0.1:8000/callback#access_token=uPYzDyan1nJfqRulCG6pMuCT6pwbpN&expires_in=36000&token_type=Bearer&scope=read+write
# fragment values
access_token=uPYzDyan1nJfqRulCG6pMuCT6pwbpN
expires_in=36000
token_type=Bearer
scope=read+write

https://127.0.0.1:8000/callback#access_token=uPYzDyan1nJfqRulCG6pMuCT6pwbpN&expires_in=36000&token_type=Bearer&scope=read+write&state=

In this case, a refresh token will not be issued. This flow is ideal for accessing the community APIs from a client.

Password

The Password grant is one of the simplest OAuth grants and involves only one step: the application presents a traditional username and password login form to collect the user’s credentials and makes a POST request to the server to exchange the password for an access token. The POST request that the application makes looks like the example below.

curl -X POST
    -H "Cache-Control: no-cache"
    -H "Content-Type: application/x-www-form-urlencoded"
    "https://<community_hostname>/oauth/token/"
    -d "client_id=${ID}"
    -d "username=${username}"
    -d "password=${password}"
    -d "grant_type=password"

To start the Password Credential flow you call /token/ endpoint direct:

curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" "https://<community_hostname>/oauth/token/" -d "grant_type=password"

The POST parameters in this request are explained below.

The server replies with an access token in the same format as the other grant types.

{
  "access_token": "jooqrnOrNa0BrNWlg68u9sl6SkdFZg",
  "expires_in": 36000,
  "token_type": "Bearer",
  "scope": "read write",
  "refresh_token": "HNvDQjjsnvDySaK0miwG4lttJEl9yD"
}

Using an Access Token

Regardless of which grant type you used, if you have an OAuth 2.0 Bearer Token you can use with the authenticated API. Set the HTTP Authorization header as Bearer to access the protected resources as in the example below:

curl -H "Authorization: Bearer jooqrnOrNa0BrNWlg68u9sl6SkdFZg"
    -X GET https://<community_hostname>/api/v2/<resource>

curl -H "Authorization: Bearer jooqrnOrNa0BrNWlg68u9sl6SkdFZg" -X GET https:///api/v2/

Refreshing an Access Token

A revoke request from a public client would omit that secret, and take the form:

curl -X POST
    -H "Cache-Control: no-cache"
    -H "Content-Type: application/x-www-form-urlencoded"
    "https://<community_hostname>/oauth/token/"
    -d "client_id=${ID}"
    -d "refresh_token=${REFRESH_TOKEN}"
    -d "grant_type=refresh_token"

curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" "https://<community_hostname>/oauth/token/" -d "client_id=${ID}" -d "refresh_token=${REFRESH_TOKEN}" -d "grant_type=refresh_token"

The server will respond wih a 200 status code on successful revocation.

Revoking an Access Token

A revoke request from a public client would omit that secret, and take the form:

curl -X POST
    -H "Cache-Control: no-cache"
    -H "Content-Type: application/x-www-form-urlencoded"
    "https://<community_hostname>/oauth/revoke_token/"
    -d "client_id=${ID}"
    -d "token=${TOKEN}"

curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" "https://<community_hostname>/oauth/revoke_token/" -d "client_id=${ID}" -d "token=${TOKEN}"

The server will respond wih a 200 status code on successful revocation.

Dynamic Preference

Get All Dynamic Preferences

Code samples

# You can also use wget
curl -X GET /api/v2/dynamic_preference/ \
  -H 'Accept: application/json'


const headers = {
  'Accept':'application/json'
};

fetch('/api/v2/dynamic_preference/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieves all available dynamic preferences.

Available sections

Addons

This section contains a collection of modules which can be added as an extra feature.

Advertising

This section provides the settings for advertising management.

Analytics

This section the settings to manage Google Analytics.

Colors

This sections contains colors preferences for application elements.

Configurations

This section contains general configurations.

Covers

This section contains covers settings for homepage.

Images

This section contains image preferences.

Logo

This section contains logo preferences.

Loyalty

This section contains all preferences for calibration of loyalty flow.

Providers

This section contains providers settings.

Staff

This section allows to customize staff status section.

Style

This section contains style settings for Community customization.

Text

This section contains text preferences.

Webmaster

This section contains the settings for checking the status of indexing and to optimize the visibility of the website.

HTTP Request

GET /api/v2/dynamic_preference/

Parameters

Name In Type Required Description
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.
search query string false A search term.
section query string false Filter all preferences in a section
ordering query string false Which field to use when ordering the results.

Example responses

200 Response

{
  "count": 123,
  "next": "string(uri)",
  "previous": "string(uri)",
  "results": [
    {
      "id": 0,
      "section": "loyalty",
      "name": "points_make_post",
      "value": "2"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer false none Total results count
» next string(uri)¦null false none Next page url
» previous string(uri)¦null false none Previous page url
» results [DynamicPreference] false none List of results

Search Dynamic Preferences

Code samples

# You can also use wget
curl -X GET /api/v2/dynamic_preference/search/ \
  -H 'Accept: application/json'


const headers = {
  'Accept':'application/json'
};

fetch('/api/v2/dynamic_preference/search/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint searches dynamic preferences.

HTTP Request

GET /api/v2/dynamic_preference/

Parameters

Name In Type Required Description
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.
search query string false A search term.
section query string false Filter all preferences in a section
ordering query string false Which field to use when ordering the results.

Example responses

200 Response

{
  "count": 123,
  "next": "string(uri)",
  "previous": "string(uri)",
  "results": [
    {
      "id": 0,
      "section": "loyalty",
      "name": "points_make_post",
      "value": "2"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer false none Total results count
» next string(uri)¦null false none Next page url
» previous string(uri)¦null false none Previous page url
» results [DynamicPreference] false none List of results

Get a Specific Dynamic Preference

Code samples

# You can also use wget
curl -X GET /api/v2/dynamic_preference/{id}/ \
  -H 'Accept: application/json'
  -H 'Authorization: Bearer {access_token}'


const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/dynamic_preference/{id}/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieves a specific dynamic preference.

HTTP Request

GET /api/v2/dynamic_preference/{id}/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this dynamic preference.

Example responses

200 Response

{
  "id": 0,
  "section": "string",
  "name": "string",
  "value": "string"
}

Responses

Status Meaning Description Schema
200 OK none DynamicPreference

SSO

Signin

Code samples

# You can also use wget
curl -X POST /api/v2/sso/signin/ \
  -H 'Authorization: Bearer {access_token}'

import requests
headers = {
  'Authorization': 'Bearer {access_token}'
}

r = requests.post('/api/v2/sso/signin/', headers = headers)

print(r.json())

const inputBody = '{}';
const headers = {
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/sso/signin/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /api/v2/sso/signin/

Signin the user authenticated with the access token.

Example responses

200 Response

{
  "id": 0,
  "ext_id": 0,
  "username": "string",
  "role": "string",
  "tags": [
    0
  ]
}

Responses

Status Meaning Description Schema
200 OK none Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» id integer true none A unique internal id identifying the authenticated user
» ext_id integer¦null true none A unique external id identifying the authenticated user
» username string true none Username of the authenticated user
» role string¦null false none Role of the user; it can be: admin, moderator, editor
» tags [integer]¦null false none List of tags id

Signup

Code samples

# You can also use wget
curl -X POST /api/v2/sso/signup/ \
  -H 'Authorization: Bearer {access_token}'
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'
  -d '{
    "username": "string",
    "ext_id": 0
 }'
import requests
headers = {
  'Authorization': 'Bearer {access_token}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}
payload = '{"username": "string","ext_id": 0}'

r = requests.post('/api/v2/sso/signup/', headers = headers, data = payload)

print(r.json())

const inputBody = '{
  "username": "string",
  "ext_id": 0
}';
const headers = {
  'Authorization':'Bearer {access_token}',
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/api/v2/sso/signup/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /api/v2/sso/signup/

Create a new account. username field must be unique and valid (valid characters are: a-z A-Z 0-9 _-).

Note: only users with the admin role can register new users.

Body parameter

{
  "ext_id": 0,
  "username": "string",
  "role": "string",
  "tags": [
    0
  ]
}
ext_id: 0
username: string
role: string
tags:
  - 0

Parameters

Name In Type Required Description
ext_id body integer true A unique external id identifying the user
username body string true The username of the user. Max 255 characters. Letters, numbers and -/_ characters
email body string false The email of the user.
password body string false The password of the user. If passed, the password must be at least 8 characters (max 128 chararacters) and it must contains at least 3 of the following 4 types of characters: lower case letters, upper case letters, numbers and special characters (eg !@#$%^&).
role body string¦null false Role of the user; it can be: admin, moderator, editor
tags body [integer]¦null false List of tags id

Example responses

201 Response

{
  "id": 0,
  "ext_id": 0,
  "username": "string",
  "role": "string",
  "tags": [
    0
  ]
}

Responses

Status Meaning Description Schema
201 Created none Inline

Response Schema

Status Code 201

Name Type Required Restrictions Description
» id integer true none The unique internal id associated to the created user
» ext_id integer¦null true none A unique external id identifying the user
» username string true none Username of the registered user
» email string false none Email of the registered user
» role string¦null false none Role of the user; it can be: admin, moderator, editor
» tags [integer]¦null false none List of tags id

User

Get All Users

Code samples

# You can also use wget
curl -X GET /api/v2/user/ \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"


const headers = {
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieve the list of all users.

HTTP Request

GET /api/v2/user/

Parameters

Name In Type Required Description
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.
search query string false A search term. Search in fields: username, real_name.
username query string false Filter using field username.
gender query string false Filter using field gender type.
real_name query string false Filter using field real_name.
location query string false Filter using field location.
description query string false Filter using field description.
ordering query string false Ordering fields (eg: ?ordering=username). Minus char is used for descending ordering, eg. -username

Example responses

200 Response

{
  "count": 123,
  "next": "http://api.example.org/accounts/?offset=400&limit=100",
  "previous": "http://api.example.org/accounts/?offset=200&limit=100",
  "results": [
    {
      "id": 0,
      "username": "string",
      "real_name": "string",
      "email": "user@example.com",
      "email_isvalid": true,
      "date_joined": "2019-08-24T14:15:22Z",
      "bio": "string",
      "location": "string",
      "location_lat_lng": "string",
      "position_lat_lng": "string",
      "date_of_birth": "2019-09-23",
      "description": "string",
      "gender": "Male",
      "status": "a",
      "website": "https://example.com",
      "avatar": "string",
      "cover": "string",
      "ext_id": 3,
      "tags": [],
      "reputation": 39,
      "connection_status": "string",
      "followings_counter": 7,
      "followers_counter": 2,
      "posts_counter": 4,
      "discussions_counter": 3,
      "statuses_counter": 0,
      "polls_counter": 1
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer false none Total results count
» next string(uri)¦null false none Next page url
» previous string(uri)¦null false none Previous page url
» results list(User) false none List of results

Users Autocomplete

Code samples

# You can also use wget
curl -X GET /api/v2/user/autocomplete/ \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"


const headers = {
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/autocomplete/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieve the list of all users that meet the search criteria. The user object returned will contain only the following attributes: id, username, real_name, ext_id and avatar.

This endpoint is recommended for implementing an autocomplete input field.

HTTP Request

GET /api/v2/user/autocomplete/

Parameters

Name In Type Required Description
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.
search query string false A search term. Search in fields: username, real_name.
username query string false Filter using field username.
gender query string false Filter using field gender type.
real_name query string false Filter using field real_name.
location query string false Filter using field location.
description query string false Filter using field description.
ordering query string false Ordering fields (eg: ?ordering=username). Minus char is used for descending ordering, eg. -username

Example responses

200 Response

{
  "count": 123,
  "next": "http://api.example.org/accounts/?offset=400&limit=100",
  "previous": "http://api.example.org/accounts/?offset=200&limit=100",
  "results": [
    {
      "id": 0,
      "username": "string",
      "real_name": "string",
      "avatar": "string",
      "ext_id": 3
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer false none Total results count
» next string(uri)¦null false none Next page url
» previous string(uri)¦null false none Previous page url
» results list(User) false none List of results. Every items will contain only the following attributes: id, username, real_name, ext_id and avatar.

Search Users

Code samples

# You can also use wget
curl -X GET /api/v2/user/search/ \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"


const headers = {
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/search/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint perform search users.

HTTP Request

GET /api/v2/user/search/

Parameters

Name In Type Required Description
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.
user query string false A search term. Search in fields: username, real_name. If this parameter is used username & real_name will be ignored.
username query string false Filter using field username.
real_name query string false Filter using field real_name.
gender query string false Filter using field gender type. Possible values: Male, Female, Unspecified.
location query string false Filter using field location.
age query string false Filter using age ranges. Possible values: -30, 30-45, 45+. The value 45+ must be encoded in the request url: 45%2B.
lat_lng query string false Filter using coordinates lat,lng.
user_position query boolean false Use the coordinates (position_lat_lng or location_lat_lng) of the authenticated user.
description query string false Filter using field description.
is_staff query boolean false Filter the users that belong to the staff.
tag query integer false Filter using tag ID.
category query integer false Filter using category ID.
ordering query string false Ordering fields (eg: ?ordering=username). Minus char is used for descending ordering, eg. -username. Possible values: username, location, real_name, distance.

Example responses

200 Response

{
  "count": 123,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": 0,
      "username": "string",
      "real_name": "string",
      "email": "user@example.com",
      "email_isvalid": true,
      "date_joined": "2019-08-24T14:15:22Z",
      "bio": "string",
      "location": "string",
      "location_lat_lng": "string",
      "position_lat_lng": "string",
      "date_of_birth": "2019-09-23",
      "description": "string",
      "gender": "Male",
      "status": "a",
      "website": "https://example.com",
      "avatar": "string",
      "cover": "string",
      "ext_id": 3,
      "tags": [],
      "reputation": 39,
      "connection_status": "string",
      "followings_counter": 7,
      "followers_counter": 2,
      "posts_counter": 4,
      "discussions_counter": 3,
      "statuses_counter": 0,
      "polls_counter": 1
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer false none Total results count
» next string(uri)¦null false none Next page url
» previous string(uri)¦null false none Previous page url
» results list(User) false none List of results

Get a Specific User

Code samples

# You can also use wget
curl -X GET /api/v2/user/{id}/ \
  -H 'Accept: application/json'

const headers = {
  'Accept':'application/json'
};

fetch('/api/v2/user/{id}/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieve a specific user's profile identified by {id}.

HTTP Request

GET /api/v2/user/{id}/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.

Example responses

200 Response

{
  "id": 0,
  "username": "string",
  "real_name": "string",
  "email": "user@example.com",
  "email_isvalid": true,
  "date_joined": "2019-08-24T14:15:22Z",
  "bio": "string",
  "location": "string",
  "location_lat_lng": "string",
  "position_lat_lng": "string",
  "date_of_birth": "2019-09-23",
  "description": "string",
  "gender": "Male",
  "status": "a",
  "website": "https://example.com",
  "avatar": "string",
  "cover": "string",
  "ext_id": 3,
  "tags": [],
  "reputation": 39,
  "connection_status": "string",
  "followings_counter": 7,
  "followers_counter": 2,
  "posts_counter": 4,
  "discussions_counter": 3,
  "statuses_counter": 0,
  "polls_counter": 1
}

Responses

Status Meaning Description Schema
200 OK none User

Get Counters of a Specific User

Code samples

# You can also use wget
curl -X GET /api/v2/user/{id}/counters/ \
  -H 'Accept: application/json'

const headers = {
  'Accept':'application/json'
};

fetch('/api/v2/user/{id}/counters/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieve the counters of a specific user identified by {id}.

HTTP Request

GET /api/v2/user/{id}/counters/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.

Example responses

200 Response

{
    "discussions": 11,
    "polls": 10,
    "posts": 2,
    "statuses": 3,
    "followings": 2,
    "followers": 1
}

Responses

Status Meaning
200 OK
Field Description Note
discussions_counter Number of discussions created by the user Only if dynamic preference configurations.discussion_type_enabled is true
posts_counter Number of posts created by the user Only if dynamic preference configurations.post_type_enabled is true
statuses_counter Number of statuses created by the user Only if dynamic preference configurations.status_type_enabled is true
polls_counter Number of polls created by the user Only if dynamic preference addons.polls_enabled is true or if the user has a staff role
followings_counter Number of followings of the user Only if dynamic preference configurations.follow_enabled is true
followers_counter Number of followers of the user Only if dynamic preference configurations.follow_enabled is true
connection_requests_sent_counter Number of connection requests sent by the user Only if dynamic preference configurations.follow_enabled is false
connection_requests_received_counter Number of connection requests received by the user Only if dynamic preference configurations.follow_enabled is false
connections_counter Number of connections of the user Only if dynamic preference configurations.follow_enabled is false

Update a Specific User

Code samples

# You can also use wget
curl -X PUT /api/v2/user/{id}/ \
  -H 'Content-Type':'multipart/form-data'
  -H 'Accept: application/json'
  -H 'Authorization: Bearer <token>'
const inputBody = '{
  "username": "string",
  "real_name": "string",
  "bio": "string",
  "location": "string",
  "location_lat_lng": "string",
  "position_lat_lng": "string",
  "date_of_birth": "string",
  "description": "string",
  "avatar": "blob",
  "cover": "blob",
  "gender": "Male",
  "website": "https://example.com"
}';
const headers = {
  'Content-Type': 'multipart/form-data',
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/{id}/',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint update the profile of a user identified by {id}. A user can only update their personal data. username field must be unique and valid (valid characters are: a-z A-Z 0-9 _-).

HTTP Request

PUT /api/v2/user/{id}/

Body parameter

{
  "username": "string",
  "real_name": "string",
  "bio": "string",
  "location": "string",
  "location_lat_lng": "string",
  "position_lat_lng": "string",
  "date_of_birth": "string",
  "description": "string",
  "gender": "Male",
  "avatar": "blob",
  "cover": "blob",
  "website": "https://example.com"
}

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.
body body User false none

Example responses

200 Response

{
  "id": 0,
  "username": "string",
  "real_name": "string",
  "email": "user@example.com",
  "email_isvalid": true,
  "date_joined": "2019-08-24T14:15:22Z",
  "bio": "string",
  "location": "string",
  "location_lat_lng": "string",
  "position_lat_lng": "string",
  "date_of_birth": "string",
  "description": "string",
  "gender": "Male",
  "status": "a",
  "website": "https://example.com",
  "avatar": "string",
  "cover": "string",
  "ext_id": 3,
  "tags": [],
  "reputation": 39,
  "connection_status": "string",
  "followings_counter": 1,
  "followers_counter": 0,
  "posts_counter": 2,
  "discussions_counter": 4,
  "statuses_counter": 1,
  "polls_counter": 6
}

Responses

Status Meaning Description Schema
200 OK none User

Patch a Specific User

Code samples

# You can also use wget
curl -X PATCH /api/v2/user/{id}/ \
  -H 'Content-Type': 'multipart/form-data'
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>'
const inputBody = {
  "username": "string",    
  "real_name": "string",
  "bio": "string",
  "location": "string",
  "location_lat_lng": "string",
  "position_lat_lng": "string",
  "date_of_birth": "string",
  "description": "string",
  "avatar": "blob",
  "cover": "blob",
  "gender": "Male",
  "website": "https://example.com"
};
const headers = {
  'Content-Type': 'multipart/form-data',
  'Accept': 'application/json',
  'Authorization: Bearer <token>'
};
fetch('/api/v2/user/{id}/',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint patch a specific user identified by {id}. A user can only update their personal data. username field must be unique and valid (valid characters are: a-z A-Z 0-9 _-).

NOTE: You can use this endpoint to edit a single field passing only the id and the needed field (without mandatory fields).

HTTP Request

PATCH /api/v2/user/{id}/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.
body body User false none

Example responses

200 Response

{
  "id": 0,
  "username": "string",
  "real_name": "string",
  "email": "user@example.com",
  "email_isvalid": true,
  "date_joined": "2019-08-24T14:15:22Z",
  "bio": "string",
  "location": "string",
  "location_lat_lng": "string",
  "position_lat_lng": "string",
  "date_of_birth": "string",
  "description": "string",
  "gender": "Male",
  "status": "a",
  "website": "https://example.com",
  "avatar": "string",
  "cover": "string",
  "ext_id": 3,
  "tags": [],
  "reputation": 39,
  "connection_status": "string",
  "followings_counter": 1,
  "followers_counter": 0,
  "posts_counter": 2,
  "discussions_counter": 4,
  "statuses_counter": 1,
  "polls_counter": 6
}

Responses

Status Meaning Description Schema
200 OK none User

Delete a Specific User

Code samples

# You can also use wget
curl -X DELETE /api/v2/user/{id}/
  -H "Authorization: Bearer <token>"

const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};
fetch('/api/v2/user/{id}/',
{
  method: 'DELETE',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

Delete a specific user identified by {id}. Only the user identified by the {id} and the administrators can delete the user. There are two ways of deleting a user: soft and hard.

Soft: the user is marked as deleted, it will not appear in the user lists, the user's posts will remain and it will not be possible to create a user with the same username and ext_id (status of the user will be set to deleted: 'd').

Hard: all user's content (profile, post, votes, etc...) will be removed (status of the user will be set to unregistered: 'u').

In particular:

HTTP Request

DELETE /api/v2/user/{id}/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.
hard query bool false If the value is set to 1, perform hard delete else execute a soft delete.

Responses

Status Meaning Description Schema
204 No Content none None

Change User's Email

Code samples

# You can also use wget
curl -X PATCH /api/v2/user/{id}/change_email/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"
const inputBody = '{
  "new_email": "user@example.com",
  "confirm": 0
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/{id}/change_email/',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

Change the email of the authenticated user.

HTTP Request

PATCH /api/v2/user/{id}/change_email/

Body parameter

{
  "new_email": "user@example.com",
  "confirm": 0
}

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.
new_email body string(email) true none
confirm body boolean false If confirm=1 (or true), the email is not changed directly but a validation code is generated to be used in the confirm call to validate the email.

Example responses (confirm=1)

201 Response

{
  "validation_code": "string"
}

Example responses (confirm=0)

204 Response

Responses

Status Meaning Description Schema
200 OK If confirm=1, the response body contains the validation code. None
204 No Content If confirm=0, there is no body response. None

Confirm User's Change Email

Code samples

# You can also use wget
curl -X POST /api/v2/user/{id}/confirm_email/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"
const inputBody = '{
  "new_email": "user@example.com",
  "confirm": false,
  "validation_code": "string"
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/{id}/confirm_email/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

Confirm email

HTTP Request

POST /api/v2/user/{id}/confirm_email/

Body parameter

{
  "new_email": "user@example.com",
  "validation_code": "string"
}

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.
new_email body string(email) true New email to confirm
validation_code body boolean false Validation code obtained with Change User's Email

Example responses

204 Response

Responses

Status Meaning Description Schema
204 No Content none None

Change User's Password

Code samples

# You can also use wget
curl -X PATCH /api/v2/user/{id}/change_password/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"
const inputBody = '{
  "password": "string",
  "new_password": "string"
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/{id}/change_password/',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

Change the password of the authenticated user.

HTTP Request

PATCH /api/v2/user/{id}/change_password/

Body parameter

{
  "password": "string",
  "new_password": "string"
}

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.
password string true none none
new_password string true none none

Example responses

204 Response

Responses

Status Meaning Description Schema
204 No Content none None

Get User's Settings

Code samples

# You can also use wget
curl -X POST /api/v2/user/{id}/settings/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/{id}/settings/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

Retrive all current user's settings for the authenticated user. See UserSettings for the list of possible user settings.

HTTP Request

GET /api/v2/user/{id}/settings/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying the current user id.

Example responses

200 Response

{
  "qa_frequency": -1,
  "email_notification_not_qa": 1,
  "interests_frequency": -1,
  "engagement_frequency": 1,
  "mobile_notifications_scmty": 1,
  "toast_notifications_emit_sound": 1,
  "show_toast_notifications": 1
}

Responses

Status Meaning Description Schema
200 OK none UserSettings

Change User's Settings

Code samples

# You can also use wget
curl -X PATCH /api/v2/user/{id}/settings/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"
const inputBody = '{
  "interests_frequency": -1,
  "engagement_frequency": 1
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/{id}/settings/',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

Change the user settings for the authenticated user. See UserSettings for the list of possible user settings.

HTTP Request

PATCH /api/v2/user/{id}/settings/

Example responses

200 Response

{
  "interests_frequency": -1,
  "engagement_frequency": 1
}

Parameters

Name In Type Required Description
id path string true A unique integer value identifying the current user id.
body body UserSettings false none

Responses

Status Meaning Description Schema
200 OK none UserSettings

Me

Code samples

# You can also use wget
curl -X GET /api/v2/user/me/ \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"


const headers = {
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/me/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

Return the user identified by the authentication token.

HTTP Request

GET /api/v2/user/me/

Example responses

200 Response

{
  "id": 0,
  "username": "string",
  "real_name": "string",
  "email": "user@example.com",
  "email_isvalid": true,
  "date_joined": "2019-08-24T14:15:22Z",
  "bio": "string",
  "location": "string",
  "location_lat_lng": "string",
  "position_lat_lng": "string",
  "date_of_birth": "string",
  "description": "string",
  "gender": "Male",
  "status": "a",
  "website": "https://example.com",
  "avatar": "string",
  "cover": "string",
  "ext_id": 3,
  "tags": [],
  "reputation": 39,
  "connection_status": "string",
  "followings_counter": 1,
  "followers_counter": 0,
  "posts_counter": 2,
  "discussions_counter": 4,
  "statuses_counter": 1,
  "polls_counter": 6,
  "permission": {
    "upload_video": false,
    "create_contribute": true,
    "create_poll": true,
    "locate_post": false,
    "create_post": true,
    "create_post_with_category": true,
    "follow_user": true,
    "request_connection": true,
    "accept_connection": true
  }
}

Responses

Status Meaning Description Schema
200 OK none User

Permission

Code samples

# You can also use wget
curl -X GET /api/v2/user/me/permission/ \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"


const headers = {
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/me/permission/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

Return a list of permissions for the user identified by the authentication token.

Some of the permissions in the list depend on global community settings.

HTTP Request

GET /api/v2/user/me/permission/

Example responses

200 Response

{
    "upload_video": false,
    "create_contribute": true,
    "create_poll": true,
    "locate_post": false,
    "create_post": true,
    "create_post_with_category": true,
    "follow_user": true,
    "request_connection": true,
    "accept_connection": true
}

Responses

Status Meaning Description Schema
200 OK none UserPermission

Get User's Feed

Code samples

# You can also use wget
curl -X GET /api/v2/user/{id}/feed/ \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"

const headers = {
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/{id}/feed/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrive the list of user's post of the user identified by {id}.

HTTP Request

GET /api/v2/user/{id}/feed/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.

Example responses

200 Response

{
  "count": 123,
  "next": "string(uri)",
  "previous": "string(uri)",
  "results": [
    {
      "type": "discussion",
      "discussion": {
        "id": 0,
        "categories": [
            {
                "id": 0,
                "order": 1,
                "name": "name",
                "name_synonyms": "synonyms",
                "slug": "name",
                "slogan": "Slogan",
                "html_info": null,
                "seo_title": null,
                "seo_description": null,
                "auto_follow": "None",
                "active": true,
                "deleted": false,
                "image_original": "string",
                "image_bigger": "string",
                "image_big": "string",
                "image_medium": "string",
                "image_small": "string",
                "emotional_image_original": "string",
                "emotional_image_position": 50,
                "lastmod_datetime": "2020-09-30T15:22:07.123058+02:00",
                "stream_order_by": "recent"
            }
        ],
        "media_type": "images",
        "medias": [
            {
                "id": 0,
                "added_at": "2019-08-24T14:15:22Z",
                "type": "url",
                "title": "string",
                "description": "string",
                "url": "https://example.com",
                "image": "string",
                "image_width": 0,
                "image_height": 0,
                "order": 0,
                "embed": {
                    "id": 0,
                    "embed_type": "string",
                    "embed_id": "string",
                    "url": "string",
                    "metadata": {}
            }
          }
        ],
        "location": {
          "location": "string",
          "lat": 0,
          "lng": 0
        },
        "poll": {
          "id": 0,
          "title": "string",
          "multiple_choices": true,
          "added_at": "2019-08-24T14:15:22Z",
          "modified_at": "2019-08-24T14:15:22Z",
          "closed": true,
          "expiration_at": "2019-08-24T14:15:22Z",
          "hidden": "string",
          "choices": [
            {
              "id": 0,
              "choice": "string",
              "order": 0,
              "added_at": "2019-08-24T14:15:22Z",
              "deleted": "string",
              "vote_count": 0,
              "voted": true
            }
          ],
          "votes": [
            {
              "id": 0,
              "choice": "string",
              "user": "string"
            }
          ]
        },
        "last_activity_at": "2019-08-24T14:15:22Z",
        "author": {
          "id": 0,
          "username": "string",
          "real_name": "string",
          "date_joined": "2019-08-24T14:15:22Z",
          "bio": "string",
          "location": "string",
          "location_lat_lng": "string",
          "position_lat_lng": "string",
          "date_of_birth": "string",
          "description": "string",
          "gender": "Male",
          "website": "https://example.com",
          "avatar": "string",
          "cover": "string",
          "ext_id": "string",
          "tags": [
            {
              "id": 0,
              "active": true,
              "type": "user",
              "name": "string",
              "description": "string",
              "color": "string",
              "visible": true,
              "deleted": true,
              "created_at": "2019-08-24T14:15:22Z"
            }
          ],
        "reputation": 111,
        "followings_counter": 1,
        "followers_counter": 0,
        "posts_counter": 2,
        "discussions_counter": 4,
        "statuses_counter": 1,
        "polls_counter": 6
        },
        "added_at": "2019-08-24T14:15:22Z",
        "html": "string",
        "summary": "string",
        "deleted": true,
        "collapsed": "string",
        "comment_count": 0,
        "vote_count": 0,
        "voted": false,
        "flag_count": 0,
        "share_count": 0,
        "addressing": [0],
        "title": "string",
        "slug": "string",
        "view_count": 0,
        "follower_count": "string"
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer false none none
» next string(uri)¦null false none none
» previous string(uri)¦null false none none
» results list(Feed) false none none

Get User's Followers

Code samples

# You can also use wget
curl -X GET /api/v2/user/{id}/followers/ \
  -H 'Accept: application/json'


const headers = {
  'Accept':'application/json'
};

fetch('/api/v2/user/{id}/followers/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieve the list of followers of a specific user identified by {id}.

HTTP Request

GET /api/v2/user/{id}/followers/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.

Example responses

200 Response

{
  "count": 123,
  "next": "string(uri)",
  "previous": "string(uri)",
  "results": [
    {
      "id": 0,
      "username": "string",
      "real_name": "string",
      "email": "user@example.com",
      "email_isvalid": true,
      "date_joined": "2019-08-24T14:15:22Z",
      "bio": "string",
      "location": "string",
      "location_lat_lng": "string",
      "position_lat_lng": "string",
      "date_of_birth": "string",
      "description": "string",
      "gender": "Male",
      "status": "a",
      "website": "https://example.com",
      "avatar": "string",
      "cover": "string",
      "ext_id": 3,
      "tags": [],
      "reputation": 39,
      "connection_status": "string",
      "followings_counter": 1,
      "followers_counter": 0,
      "posts_counter": 2,
      "discussions_counter": 4,
      "statuses_counter": 1,
      "polls_counter": 6
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none User

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer false none none
» next string(uri)¦null false none none
» previous string(uri)¦null false none none
» results list(User) false none none

Get User's Following

Code samples

# You can also use wget
curl -X GET /api/v2/user/{id}/followings/ \
  -H 'Accept: application/json'


const headers = {
  'Accept':'application/json'
};

fetch('/api/v2/user/{id}/followings/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieve the list of following of a specific user identified by {id}.

HTTP Request

GET /api/v2/user/{id}/followings/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.

Example responses

200 Response

{
  "count": 123,
  "next": "string(uri)",
  "previous": "string(uri)",
  "results": [
    {
      "id": 0,
      "username": "string",
      "real_name": "string",
      "email": "user@example.com",
      "email_isvalid": true,
      "date_joined": "2019-08-24T14:15:22Z",
      "bio": "string",
      "location": "string",
      "location_lat_lng": "string",
      "position_lat_lng": "string",
      "date_of_birth": "string",
      "description": "string",
      "gender": "Male",
      "status": "a",
      "website": "https://example.com",
      "avatar": "string",
      "cover": "string",
      "ext_id": 3,
      "tags": [],
      "reputation": 39,
      "connection_status": "string",
      "followings_counter": 1,
      "followers_counter": 0,
      "posts_counter": 2,
      "discussions_counter": 4,
      "statuses_counter": 1,
      "polls_counter": 6
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none User

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer false none none
» next string(uri)¦null false none none
» previous string(uri)¦null false none none
» results list(User) false none none

Follow User

Code samples

# You can also use wget
curl -X POST /api/v2/user/{id}/follow/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/{id}/follow/',
{
  method: 'POST',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint allows a user to follow another user identified by {id}.

Note: If a user already follows the user, it will be unfollowed.

HTTP Request

POST /api/v2/user/{id}/follow/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.

Example responses

204 Response

Responses

Status Meaning Description Schema
204 No Content none None

Check User Followed

Code samples

# You can also use wget
curl -X GET /api/v2/user/{id}/is_followed/ \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"

const headers = {
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/{id}/is_followed/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

Return is_followed=true if the user (identified in path) is followed by me.

HTTP Request

GET /api/v2/user/{id}/is_followed/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.

Example responses

200 Response

{
    "is_followed": true
}

Responses

Status Meaning Description Schema
200 OK none none

Check User Follower

Code samples

# You can also use wget
curl -X GET /api/v2/user/{id}/is_follower/ \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"

const headers = {
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/{id}/is_follower/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

Return is_follower=true if the user (identified in path) follow me.

HTTP Request

GET /api/v2/user/{id}/is_follower/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.

Example responses

200 Response

{
    "is_follower": false
}

Responses

Status Meaning Description Schema
200 OK none none

Get User's Connections

Code samples

# You can also use wget
curl -X GET /api/v2/user/{id}/connections/ \
  -H 'Accept: application/json'

const headers = {
  'Accept':'application/json',
};

fetch('/api/v2/user/{id}/connections/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieve the list of connections of a specific user identified by id.

HTTP Request

GET /api/v2/user/{id}/connections/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.

Example responses

200 Response

{
  "count": 123,
  "next": "string(uri)",
  "previous": "string(uri)",
  "results": [
    {
      "id": 0,
      "username": "string",
      "real_name": "string",
      "email": "user@example.com",
      "email_isvalid": true,
      "date_joined": "2019-08-24T14:15:22Z",
      "bio": "string",
      "location": "string",
      "location_lat_lng": "string",
      "position_lat_lng": "string",
      "date_of_birth": "string",
      "description": "string",
      "gender": "Male",
      "status": "a",
      "website": "https://example.com",
      "avatar": "string",
      "cover": "string",
      "ext_id": 3,
      "tags": [],
      "reputation": 39,
      "connection_status": "string",
      "connection_requests_sent_counter": 0,
      "connection_requests_received_counter": 1,
      "connections_counter": 0,
      "posts_counter": 2,
      "discussions_counter": 4,
      "statuses_counter": 1,
      "polls_counter": 6
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none User

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer false none none
» next string(uri)¦null false none none
» previous string(uri)¦null false none none
» results list(User) false none none

Check User Connection

Code samples

# You can also use wget
curl -X GET /api/v2/user/{id}/is_connection/ \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"

const headers = {
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/{id}/is_connection/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

Return is_connection=true if the user (identified in path) is connected with me.

HTTP Request

GET /api/v2/user/{id}/is_connection/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.

Example responses

200 Response

{
    "is_connection": false
}

Responses

Status Meaning Description Schema
200 OK none none

Get User's Connection Requests

Code samples

# You can also use wget
curl -X GET /api/v2/user/{id}/connection_requests/ \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"


const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {token}'
};

fetch('/api/v2/user/{id}/connection_requests/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieve the list of connection requests received of a specific user identified by id.

HTTP Request

GET /api/v2/user/{id}/connection/requests/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.

Example responses

200 Response

{
  "count": 123,
  "next": "string(uri)",
  "previous": "string(uri)",
  "results": [
    {
        "from_user": {
        "id": 0,
        "username": "string",
        "real_name": "string",
        "date_joined": "2019-08-24T14:15:22Z",
        "bio": "string",
        "location": "string",
        "location_lat_lng": "string",
        "position_lat_lng": "string",
        "date_of_birth": "string",
        "description": "string",
        "gender": "Male",
        "status": "a",
        "website": "https://example.com",
        "avatar": "string",
        "cover": "string",
        "ext_id": 1,
        "tags": [],
        "reputation": 39,
        "connection_status": "string",
        "connection_requests_sent_counter": 1,
        "connection_requests_received_counter": 0,
        "connections_counter": 0,
        "posts_counter": 0,
        "discussions_counter": 0,
        "statuses_counter": 0,
        "polls_counter": 0
      },
      "created": "2019-08-24T14:15:22Z",
      "rejected": "2019-08-24T14:15:22Z",
      "viewed": "2019-08-24T14:15:22Z"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none ConnectionRequest

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer false none none
» next string(uri)¦null false none none
» previous string(uri)¦null false none none
» results [ConnectionRequest] false none none

Get User's Connection Requests sent

Code samples

# You can also use wget
curl -X GET /api/v2/user/{id}/connection/requests_sent/ \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"

const headers = {
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/{id}/connection/requests_sent/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieve a specific user's list of connection requests sent by user.

HTTP Request

GET /api/v2/user/{id}/connection/requests_sent/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.

Example responses

200 Response

{
  "count": 123,
  "next": "string(uri)",
  "previous": "string(uri)",
  "results": [
    {
      "to_user": {
        "id": 0,
        "username": "string",
        "real_name": "string",
        "date_joined": "2019-08-24T14:15:22Z",
        "bio": "string",
        "location": "string",
        "location_lat_lng": "string",
        "position_lat_lng": "string",
        "date_of_birth": "string",
        "description": "string",
        "gender": "Male",
        "status": "a",
        "website": "https://example.com",
        "avatar": "string",
        "cover": "string",
        "ext_id": 3,
        "tags": [],
        "reputation": 39,
        "connection_status": "string",
        "connection_requests_sent_counter": 0,
        "connection_requests_received_counter": 1,
        "connections_counter": 0,
        "posts_counter": 2,
        "discussions_counter": 4,
        "statuses_counter": 1,
        "polls_counter": 6
      },
      "created": "2019-08-24T14:15:22Z",
      "rejected": "2019-08-24T14:15:22Z",
      "viewed": "2019-08-24T14:15:22Z"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none ConnectionRequest

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer false none none
» next string(uri)¦null false none none
» previous string(uri)¦null false none none
» results [ConnectionRequest] false none none

Accept a User Connection

Code samples

# You can also use wget
curl -X POST /api/v2/user/{id}/connection/accept/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/{id}/connection/accept/',
{
  method: 'POST',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint accept a request connection of the user identified by {id}.

HTTP Request

POST /api/v2/user/{id}/connection/accept/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.

Example responses

204 Response

Responses

Status Meaning Description Schema
204 No Content none None

Request Connection

Code samples

# You can also use wget
curl -X POST /api/v2/user/{id}/connection/request/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"

const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/{id}/connection/request/',
{
  method: 'POST',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint request connection to the user identified by {id}.

HTTP Request

POST /api/v2/user/{id}/connection/request/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.

Example responses

204 Response

Responses

Status Meaning Description Schema
204 No Content none None

Remove a Connection

Code samples

# You can also use wget
curl -X POST /api/v2/user/{id}/connection/remove/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/{id}/connection/remove/',
{
  method: 'POST',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint remove connection with the user identified by {id}.

HTTP Request

POST /api/v2/user/{id}/connection/remove/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.

Example responses

204 Response

Responses

Status Meaning Description Schema
204 No Content none None

Cancel a Rejected Connection

Code samples

# You can also use wget
curl -X POST /api/v2/user/{id}/connection/cancel_reject/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/{id}/connection/cancel_reject/',
{
  method: 'POST',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint cancel reject connection to a user identified by {id}.

HTTP Request

POST /api/v2/user/{id}/connection/cancel_reject/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.

Example responses

204 Response

Responses

Status Meaning Description Schema
204 No Content none None

Cancel a Request Connection

Code samples

# You can also use wget
curl -X POST /api/v2/user/{id}/connection/cancel_request/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/{id}/connection/cancel_request/',
{
  method: 'POST',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint cancel a request connection for a user.

HTTP Request

POST /api/v2/user/{id}/connection/cancel_request/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.

Example responses

204 Response

Responses

Status Meaning Description Schema
204 No Content none None

Reject a Connection Request

Code samples

# You can also use wget
curl -X POST /api/v2/user/{id}/connection/reject/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/{id}/connection/reject/',
{
  method: 'POST',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint reject a connection request sent from user identified by {id}.

HTTP Request

POST /api/v2/user/{id}/connection/reject/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.

Example responses

204 Response

Responses

Status Meaning Description Schema
204 No Content none None

Mark Seen a Connection Request

Code samples

# You can also use wget
curl -X POST /api/v2/user/{id}/connection_requests/mark_seen/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/{id}/connection_requests/mark_seen/',
{
  method: 'POST',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint mark seen a connection request of user identified by {id} for the user authenticated.

HTTP Request

POST /api/v2/user/{id}/connection_requests/mark_seen/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.

Example responses

204 Response

Responses

Status Meaning Description Schema
204 No Content none None

Show/Hide User

Code samples

# You can also use wget
curl -X POST /api/v2/user/{id}/hide/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/{id}/hide/',
{
  method: 'POST',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint show/hide a user (user and user's post) identified by {id} for the authenticated user.

HTTP Request

POST /api/v2/user/{id}/hide/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.

Example responses

204 Response

Responses

Status Meaning Description Schema
204 No Content none None

Check User Hidden

Code samples

# You can also use wget
curl -X GET /api/v2/user/{id}/is_hidden/ \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"

const headers = {
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/{id}/is_hidden/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

Return true if the user (identified in path) is hidden by me

HTTP Request

GET /api/v2/user/{id}/is_hidden/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.

Example responses

200 Response

{
    "is_hidden": true
}

Responses

Status Meaning Description Schema
200 OK none none

Check User Hidden By

Code samples

# You can also use wget
curl -X GET /api/v2/user/{id}/is_hidden_by/ \
  -H 'Accept: application/json'
  -H "Authorization: Bearer <token>"

const headers = {
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};

fetch('/api/v2/user/{id}/is_hidden_by/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

Return true if the user (identified in path) has hidden me

HTTP Request

GET /api/v2/user/{id}/is_hidden_by/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.

Example responses

200 Response

{
    "is_hidden_by": true
}

Responses

Status Meaning Description Schema
200 OK none none

Get User's Loyalty Points

Code samples

# You can also use wget
curl -X GET /api/v2/user/{id}/loyalty/points/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <token>'


const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer <token>'
};

fetch('/api/v2/user/{id}/loyalty/points/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

Return loyalty points of the user

HTTP Request

GET /api/v2/user/{id}/loyalty/points/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this user.

Example responses

200 Response

{
  "points": 0
}

Responses

Status Meaning Description Schema
200 OK none User

List User's Connections Statuses

Code samples

# You can also use wget
curl -X POST /api/v2/user/connection/statuses/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <token>'

const inputBody = '{
  "users": [
    1,7,9
  ]
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization': 'Bearer <token>'
};

fetch('/api/v2/user/connection/statuses/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint list the connection/follow statuses of the logged user starting from a users array

HTTP Request

POST /api/v2/user/connection/statuses/

Body parameter

{
  "users": [
    1,7,9
  ]
}

Parameters

Name In Type Required Description
body body Array of user ids false none

Example responses

200 Response

{
    "connection_statuses": {
        "1": null,
        "7": "followed",
        "9": null
    }
}

Responses

Status Meaning Description Schema
200 Created none Array of user ids and connection statuses

Get User's Tags to Address a Contribution

Code samples

# You can also use wget
curl -X GET /api/v2/user/tag/tags_to_address_a_contribution/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <token>'

const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer <token>'
};

fetch('/api/v2/user/tag/tags_to_address_a_contribution/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint return user's tags to address a contribution

HTTP Request

GET /api/v2/user/tag/tags_to_address_a_contribution/

Example responses

200 Response

[
    {
      "id": 0,
      "active": true,
      "type": "user",
      "name": "string",
      "description": "string",
      "color": "string",
      "visible": true,
      "deleted": true,
      "created_at": "2019-08-24T14:15:22Z"
    },
    {
      "id": 0,
      "active": true,
      "type": "user",
      "name": "string",
      "description": "string",
      "color": "string",
      "visible": true,
      "deleted": true,
      "created_at": "2019-08-24T14:15:22Z"
    }
]

Responses

Status Meaning Description Schema
200 OK none Tag

Locality

Get Localities

Code samples

# You can also use wget
curl -X GET /api/v2/locality/ \
  -H 'Accept: application/json'


const headers = {
  'Accept':'application/json'
};

fetch('/api/v2/locality/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieve the list of available localities.

HTTP Request

GET /api/v2/locality/

Parameters

Name In Type Required Description
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.
search query string false A search term.

Example responses

200 Response

{
  "count": 123,
  "next": "string",
  "previous": "string",
  "results": [
    {
      "full_address": "string",
      "postal_code": "string",
      "town": "string",
      "province": "string",
      "province_short": "string",
      "region": "string",
      "country": "string",
      "lat": 0,
      "lng": 0
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer false none Total number of results
» next string(uri)¦null false none none
» previous string(uri)¦null false none none
» results list(Locality) false none none

Search Localities

Code samples

# You can also use wget
curl -X GET /api/v2/locality/search/ \
  -H 'Accept: application/json'


const headers = {
  'Accept':'application/json'
};

fetch('/api/v2/locality/search/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint searches localities.

HTTP Request

GET /api/v2/locality/search/

Parameters

Name In Type Required Description
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.
search query string false A search term.

Example responses

200 Response

{
  "count": 123,
  "next": "string",
  "previous": "string",
  "results": [
    {
      "full_address": "string",
      "postal_code": "string",
      "town": "string",
      "province": "string",
      "province_short": "string",
      "region": "string",
      "country": "string",
      "lat": 0,
      "lng": 0
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer false none Total number of results
» next string(uri)¦null false none none
» previous string(uri)¦null false none none
» results list(Locality) false none none

Loyalty

Get All Prizes

Code samples

# You can also use wget
curl -X GET /api/v2/loyalty/prize/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}'


const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/loyalty/prize/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieves all prizes.

HTTP Request

GET /api/v2/loyalty/prize/

Parameters

Name In Type Required Description
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.
search query string false A search term.
active query string false Filter by active only for editor or admin users
ordering query string false Which field to use when ordering the results.

Example responses

200 Response

{
  "count": 123,
  "next": "http://api.example.org/accounts/?offset=400&limit=100",
  "previous": "http://api.example.org/accounts/?offset=200&limit=100",
  "results": [
    {
      "id": 0,
      "active": true,
      "title": "string",
      "description": "string",
      "points": 0,
      "link": "https://example.com",
      "image": "string",
      "created_at": "2019-08-24T14:15:22Z",
      "lastmod_datetime": "2019-08-24T14:15:22Z",
      "created_by": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer false none none
» next string(uri)¦null false none none
» previous string(uri)¦null false none none
» results [LoyaltyPrize] false none none

Create a Prize

Code samples

# You can also use wget
curl -X POST /api/v2/loyalty/prize/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}' \
  --DATA '{body}'
const inputBody = '{
  "active": true,
  "title": "string",
  "description": "string",
  "points": 0,
  "link": "https://example.com",
  "image": "string"
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/loyalty/prize/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint creates a prize.

HTTP Request

POST /api/v2/loyalty/prize/

Body parameter

{
  "active": true,
  "title": "string",
  "description": "string",
  "points": 0,
  "link": "https://example.com",
  "image": "string"
}

Parameters

Name In Type Required Description
body body LoyaltyPrize false none

Example responses

201 Response

{
  "id": 0,
  "active": true,
  "title": "string",
  "description": "string",
  "points": 0,
  "link": "https://example.com",
  "image": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "lastmod_datetime": "2019-08-24T14:15:22Z",
  "created_by": "string"
}

Responses

Status Meaning Description Schema
201 Created none LoyaltyPrize

Get a Specific Prize

Code samples

# You can also use wget
curl -X GET /api/v2/loyalty/prize/{id}/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}'


const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/loyalty/prize/{id}/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieves a specific prize.

HTTP Request

GET /api/v2/loyalty/prize/{id}/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this loyalty prize.

Example responses

200 Response

{
  "id": 0,
  "active": true,
  "title": "string",
  "description": "string",
  "points": 0,
  "link": "https://example.com",
  "image": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "lastmod_datetime": "2019-08-24T14:15:22Z",
  "created_by": "string"
}

Responses

Status Meaning Description Schema
200 OK none LoyaltyPrize

Update a Specific Prize

Code samples

# You can also use wget
curl -X PUT /api/v2/loyalty/prize/{id}/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}' \
  --DATA '{body}'
const inputBody = '{
  "active": true,
  "title": "string",
  "description": "string",
  "points": 0,
  "link": "https://example.com",
  "image": "string"
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/loyalty/prize/{id}/',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint updates a specific prize.

HTTP Request

PUT /api/v2/loyalty/prize/{id}/

Body parameter

{
  "active": true,
  "title": "string",
  "description": "string",
  "points": 0,
  "link": "https://example.com",
  "image": "string"
}

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this loyalty prize.
body body LoyaltyPrize false none

Example responses

200 Response

{
  "id": 0,
  "active": true,
  "title": "string",
  "description": "string",
  "points": 0,
  "link": "https://example.com",
  "image": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "lastmod_datetime": "2019-08-24T14:15:22Z",
  "created_by": "string"
}

Responses

Status Meaning Description Schema
200 OK none LoyaltyPrize

Patch a Specific Prize

Code samples

# You can also use wget
curl -X PATCH /api/v2/loyalty/prize/{id}/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}' \
  --DATA '{body}'
const inputBody = '{
  "active": true,
  "title": "string",
  "description": "string",
  "points": 0,
  "link": "https://example.com",
  "image": "string"
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/loyalty/prize/{id}/',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint patch a specific prize.

NOTE: You can use this endpoint to edit a single field passing only the id and the needed field (without mandatory fields).

For example to change active flag in an admin list/table interface.

HTTP Request

PATCH /api/v2/loyalty/prize/{id}/

Body parameter

{
  "active": true,
  "title": "string",
  "description": "string",
  "points": 0,
  "link": "https://example.com",
  "image": "string"
}

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this loyalty prize.
body body LoyaltyPrize false none

Example responses

200 Response

{
  "id": 0,
  "active": true,
  "title": "string",
  "description": "string",
  "points": 0,
  "link": "https://example.com",
  "image": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "lastmod_datetime": "2019-08-24T14:15:22Z",
  "created_by": "string"
}

Responses

Status Meaning Description Schema
200 OK none LoyaltyPrize

Get All Prizes Requests

Code samples

# You can also use wget
curl -X GET /api/v2/loyalty/request/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}'


const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/loyalty/request/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieves all requests of loyalty prizes.

HTTP Request

GET /api/v2/loyalty/request/

Parameters

Name In Type Required Description
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.
search query string false A search term.
status query string false status
user_id query string false user_id
prize_id query string false prize_id
ordering query string false Which field to use when ordering the results.

Enumerated Values

Parameter Value Description
status 0 pending
status 1 refused
status 2 sent

Example responses

200 Response

{
  "count": 123,
  "next": "http://api.example.org/accounts/?offset=400&limit=100",
  "previous": "http://api.example.org/accounts/?offset=200&limit=100",
  "results": [
    {
      "id": 0,
      "user": {
        "id": 0,
        "username": "string",
        "real_name": "string",
        "email": "user@example.com",
        "description": "string",
        "avatar": "string"
      },
      "pending_at": "2019-08-24T14:15:22Z",
      "prize": {
        "id": 0,
        "active": true,
        "title": "string",
        "description": "string",
        "points": 0,
        "link": "https://example.com",
        "image": "string"
      },
      "prize_points": 0,
      "status": 0,
      "status_description": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer false none none
» next string(uri)¦null false none none
» previous string(uri)¦null false none none
» results [LoyaltyPrizeUser] false none none

Create a Prize Request

Code samples

# You can also use wget
curl -X POST /api/v2/loyalty/request/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}' \
  --DATA '{body}'
const inputBody = '{
  "prize": 0
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/loyalty/request/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint creates a request for a loyalty prize.

HTTP Request

POST /api/v2/loyalty/request/

Body parameter

{
  "prize": 0
}

Parameters

Name In Type Required Description
prize body integer true A unique integer value identifying the requested prize.

Example responses

201 Response

{
  "id": 0,
  "user": {
    "id": 0,
    "username": "string",
    "real_name": "string",
    "email": "user@example.com",
    "description": "string",
    "avatar": "string"
  },
  "pending_at": "2019-08-24T14:15:22Z",
  "prize": {
    "id": 0,
    "active": true,
    "title": "string",
    "description": "string",
    "points": 0,
    "link": "https://example.com",
    "image": "string"
  },
  "prize_points": 0,
  "status": 0,
  "status_description": "string"
}

Responses

Status Meaning Description Schema
201 Created none LoyaltyPrizeUser

Get a Specific Prize Request

Code samples

# You can also use wget
curl -X GET /api/v2/loyalty/request/{id}/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}'


const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/loyalty/request/{id}/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieves a specific request for a loyalty prize.

HTTP Request

GET /api/v2/loyalty/request/{id}/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this request.

Example responses

200 Response

{
  "id": 0,
  "user": {
    "id": 0,
    "username": "string",
    "real_name": "string",
    "email": "user@example.com",
    "description": "string",
    "avatar": "string"
  },
  "pending_at": "2019-08-24T14:15:22Z",
  "prize": {
    "id": 0,
    "active": true,
    "title": "string",
    "description": "string",
    "points": 0,
    "link": "https://example.com",
    "image": "string"
  },
  "prize_points": 0,
  "status": 0,
  "status_description": "string"
}

Responses

Status Meaning Description Schema
200 OK none LoyaltyPrizeUser

Patch a Specific Prize Request

Code samples

# You can also use wget
curl -X PATCH /api/v2/loyalty/request/{id}/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}' \
  --DATA '{body}'

const inputBody = '{
  "status": 0
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/loyalty/request/{id}/',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint patch a specific request for a loyalty prize.

NOTE: You can use this endpoint to to change status in an admin list/table interface.

HTTP Request

PATCH /api/v2/loyalty/request/{id}/

Body parameter

{
  "status": 0
}

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this loyalty prize user.
body body LoyaltyPrizeUser false none

Enumerated Values

Parameter Value Description
status 0 pending
status 1 refused
status 2 sent

Example responses

200 Response

{
  "id": 0,
  "user": {
    "id": 0,
    "username": "string",
    "real_name": "string",
    "email": "user@example.com",
    "description": "string",
    "avatar": "string"
  },
  "pending_at": "2019-08-24T14:15:22Z",
  "prize": {
    "id": 0,
    "active": true,
    "title": "string",
    "description": "string",
    "points": 0,
    "link": "https://example.com",
    "image": "string"
  },
  "prize_points": 0,
  "status": 0,
  "status_description": "string"
}

Responses

Status Meaning Description Schema
200 OK none LoyaltyPrizeUser

Category

Get All Categories

Code samples

# You can also use wget
curl -X GET /api/v2/category/ \
  -H 'Accept: application/json'
  -H 'Authorization: Bearer {access_token}'

const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/category/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieves all categories.

HTTP Request

GET /api/v2/category/

Parameters

Name In Type Required Description
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.
search query string false A search term.
active query string false Filter using field active (only if user is administrator).
deleted query string false Filter using field deleted (only if user is administrator).

Example responses

200 Response

{
  "count": 123,
  "next": "string(uri)",
  "previous": "string(uri)",
  "results": [
    {
      "id": 0,
      "tags": [],
      "order": 123,
      "name": "string",
      "name_synonyms": "string",
      "slug": "string",
      "slogan": "string",
      "html_info": "string",
      "seo_title": "string",
      "seo_description": "string",
      "auto_follow": "string",
      "active": true,
      "deleted": false,
      "image_original": "string",
      "image_bigger": "string",
      "image_big": "string",
      "image_medium": "string",
      "image_small": "string",
      "emotional_image_original": "string",
      "emotional_image_position": 123,
      "lastmod_datetime": "2019-08-24T14:15:22Z",
      "stream_order_by": "string",
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer false none Total results count
» next string(uri)¦null false none Next page url
» previous string(uri)¦null false none Previous page url
» results list(Category) false none List of results

Search a Category

Code samples

# You can also use wget
curl -X GET /api/v2/category/search/ \
  -H 'Accept: application/json'
  -H 'Authorization: Bearer {access_token}'

const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/category/search/',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint perform search of a Category

HTTP Request

GET /api/v2/category/search/

Parameters

Name In Type Required Description
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.
search query string false A search term.
active query string false Filter using field active (only if user is administrator).
deleted query string false Filter using field deleted (only if user is administrator).

Example responses

200 Response

{
  "count": 123,
  "next": "string(uri)",
  "previous": "string(uri)",
  "results": [
    {
      "id": 0,
      "tags": [],
      "order": 123,
      "name": "string",
      "name_synonyms": "string",
      "slug": "string",
      "slogan": "string",
      "html_info": "string",
      "seo_title": "string",
      "seo_description": "string",
      "auto_follow": "string",
      "active": true,
      "deleted": false,
      "image_original": "string",
      "image_bigger": "string",
      "image_big": "string",
      "image_medium": "string",
      "image_small": "string",
      "emotional_image_original": "string",
      "emotional_image_position": 123,
      "lastmod_datetime": "2019-08-24T14:15:22Z",
      "stream_order_by": "string",

    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer false none Total results count
» next string(uri)¦null false none Next page url
» previous string(uri)¦null false none Previous page url
» results list(Category) false none List of results

Create a Category

Code samples

# You can also use wget
curl -X POST /api/v2/category/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json'
  -H 'Authorization: Bearer {access_token}'
  --DATA '{body}'
const inputBody = '{
  "order": 123,
  "name": "string",
  "name_synonyms": "string",
  "slug": "string",
  "slogan": "string",
  "html_info": "string",
  "seo_title": "string",
  "seo_description": "string",
  "auto_follow": "none",
  "active": true,
  "deleted": false,
  "image_original": "string",
  "emotional_image_original": "string",
  "emotional_image_position": 123,
  "lastmod_datetime": "2019-08-24T14:15:22Z",
  "stream_order_by": "recent"
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/category/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint creates a category.

HTTP Request

POST /api/v2/category/

Body parameter

{
  "order": 123,
  "name": "string",
  "name_synonyms": "string",
  "slug": "string",
  "slogan": "string",
  "html_info": "string",
  "seo_title": "string",
  "seo_description": "string",
  "auto_follow": "none",
  "active": true,
  "deleted": false,
  "image_original": "string",
  "emotional_image_original": "string",
  "emotional_image_position": 123,
  "lastmod_datetime": "2019-08-24T14:15:22Z",
  "stream_order_by": "recent"
}

Parameters

Name In Type Required Description
body body Category false none

Example responses

201 Response

{
  "id": 0,
  "order": 123,
  "name": "string",
  "name_synonyms": "string",
  "slug": "string",
  "slogan": "string",
  "html_info": "string",
  "seo_title": "string",
  "seo_description": "string",
  "auto_follow": "none",
  "active": true,
  "deleted": false,
  "image_original": "string",
  "image_bigger": "string",
  "image_big": "string",
  "image_medium": "string",
  "image_small": "string",
  "emotional_image_original": "string",
  "emotional_image_position": 123,
  "lastmod_datetime": "2019-08-24T14:15:22Z",
  "stream_order_by": "recent",
   "tags": []
}

Responses

Status Meaning Description Schema
201 Created none Category

Get a Specific Category

Code samples

# You can also use wget
curl -X GET /api/v2/category/{id}/ \
  -H 'Accept: application/json'
  -H 'Authorization: Bearer {access_token}'
const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/category/{id}/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieves a specific category.

HTTP Request

GET /api/v2/category/{id}/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this category.

Example responses

200 Response

{
  "id": 0,
  "tags": [],
  "order": 123,
  "name": "string",
  "name_synonyms": "string",
  "slug": "string",
  "slogan": "string",
  "html_info": "string",
  "seo_title": "string",
  "seo_description": "string",
  "auto_follow": "none",
  "active": true,
  "deleted": false,
  "image_original": "string",
  "image_bigger": "string",
  "image_big": "string",
  "image_medium": "string",
  "image_small": "string",
  "emotional_image_original": "string",
  "emotional_image_position": 123,
  "lastmod_datetime": "2019-08-24T14:15:22Z",
  "stream_order_by": "recent",

}

Responses

Status Meaning Description Schema
200 OK none Category

Update a Specific Category

Code samples

# You can also use wget
curl -X PUT /api/v2/category/{id}/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json'
  -H 'Authorization: Bearer {access_token}'
  --DATA '{body}'
const inputBody = '{
  "order": 123,
  "name": "string",
  "name_synonyms": "string",
  "slug": "string",
  "slogan": "string",
  "html_info": "string",
  "seo_title": "string",
  "seo_description": "string",
  "auto_follow": "none",
  "active": true,
  "deleted": false,
  "image_original": "string",
  "emotional_image_original": "string",
  "emotional_image_position": 123,
  "lastmod_datetime": "2019-08-24T14:15:22Z",
  "stream_order_by": "recent"
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/category/{id}/',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint updates a specific category.

HTTP Request

PUT /api/v2/category/{id}/

Body parameter

{
  "order": 123,
  "name": "string",
  "name_synonyms": "string",
  "slug": "string",
  "slogan": "string",
  "html_info": "string",
  "seo_title": "string",
  "seo_description": "string",
  "auto_follow": "none",
  "active": true,
  "deleted": false,
  "image_original": "string",
  "emotional_image_original": "string",
  "emotional_image_position": 123,
  "lastmod_datetime": "2019-08-24T14:15:22Z",
  "stream_order_by": "recent"
}

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this Category.
body body Category false none

Example responses

200 Response

{
  "id": 0,
  "tags": [],
  "order": 123,
  "name": "string",
  "name_synonyms": "string",
  "slug": "string",
  "slogan": "string",
  "html_info": "string",
  "seo_title": "string",
  "seo_description": "string",
  "auto_follow": "string",
  "active": true,
  "deleted": false,
  "image_original": "string",
  "image_bigger": "string",
  "image_big": "string",
  "image_medium": "string",
  "image_small": "string",
  "emotional_image_original": "string",
  "emotional_image_position": 123,
  "lastmod_datetime": "2019-08-24T14:15:22Z",
  "stream_order_by": "string",
}

Responses

Status Meaning Description Schema
200 OK none Category

Patch a Specific Category

Code samples

# You can also use wget
curl -X PATCH /api/v2/category/{id}/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json'
  -H 'Authorization: Bearer {access_token}'
  --DATA '{body}'
const inputBody = '{
  "order": 123,
  "name": "string",
  "name_synonyms": "string",
  "slug": "string",
  "slogan": "string",
  "html_info": "string",
  "seo_title": "string",
  "seo_description": "string",
  "auto_follow": "none",
  "active": true,
  "deleted": false,
  "image_original": "string",
  "emotional_image_original": "string",
  "emotional_image_position": 123,
  "lastmod_datetime": "2019-08-24T14:15:22Z",
  "stream_order_by": "recent"
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/category/{id}/',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint patch a specific category.

NOTE: You can use this endpoint to edit a single field passing only the id and the needed field (without mandatory fields).

For example to change active or deleted flags in an admin list/table interface.

HTTP Request

PATCH /api/v2/category/{id}/

Body parameter

{
  "order": 123,
  "name": "string",
  "name_synonyms": "string",
  "slug": "string",
  "slogan": "string",
  "html_info": "string",
  "seo_title": "string",
  "seo_description": "string",
  "auto_follow": "none",
  "active": true,
  "deleted": false,
  "image_original": "string",
  "emotional_image_original": "string",
  "emotional_image_position": 123,
  "lastmod_datetime": "2019-08-24T14:15:22Z",
  "stream_order_by": "recent"
}

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this Category.
body body Category false none

Example responses

200 Response

{
  "id": 0,
  "tags": [],
  "order": 123,
  "name": "string",
  "name_synonyms": "string",
  "slug": "string",
  "slogan": "string",
  "html_info": "string",
  "seo_title": "string",
  "seo_description": "string",
  "auto_follow": "string",
  "active": true,
  "deleted": false,
  "image_original": "string",
  "image_bigger": "string",
  "image_big": "string",
  "image_medium": "string",
  "image_small": "string",
  "emotional_image_original": "string",
  "emotional_image_position": 123,
  "lastmod_datetime": "2019-08-24T14:15:22Z",
  "stream_order_by": "string",
}

Responses

Status Meaning Description Schema
200 OK none Category

Delete a Specific Category

Code samples

# You can also use wget
curl -X DELETE /api/v2/category/{id}/
  -H "Authorization: Bearer <token>"

const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization: Bearer <token>'
};
fetch('/api/v2/category/{id}/',
{
  method: 'DELETE',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

Delete a specific category identified by {id}. There are two ways of deleting a category: soft and hard.

soft: the category is marked as deleted and not active, so it will not be possible to create a new category with the same name/slug.

hard: the category is: marked as deleted, marked as not active and the name/slug is changed to make possibile to create a new category with the same name/slug.

In particular:

HTTP Request

DELETE /api/v2/category/{id}/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this category.
hard query bool false If the value is set to 1, perform hard delete else execute a soft delete.

Responses

Status Meaning Description Schema
204 No Content none None

Get Category's Audience

Code samples

# You can also use wget
curl -X GET /api/v2/category/{id}/audience/ \
  -H 'Accept: application/json'
  -H 'Authorization: Bearer {access_token}'
const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/category/{id}/audience/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint returns the audience of a specific category.

HTTP Request

GET /api/v2/category/{id}/audience/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this Category.

Example responses

200 Response

{
  "category_audience": 123,
  "connections_audience": 123
}

Responses

Status Meaning Description Schema
200 OK none Category

Get Category's Followers

Code samples

# You can also use wget
curl -X GET /api/v2/category/{id}/followers/ \
  -H 'Accept: application/json'
  -H 'Authorization: Bearer {access_token}'
const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/category/{id}/followers/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint returns all followers of a specific category.

HTTP Request

GET /api/v2/category/{id}/followers/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this Category.

Example responses

200 Response

{
  "count": 123,
  "next": "string(uri)",
  "previous": "string(uri)",
  "results": [
    {
      "id": 1,
      "username": "string",
      "real_name": "string",
      "date_joined": "2019-08-24T14:15:22Z",
      "bio": "string",
      "location": "string",
      "location_lat_lng": "string",
      "position_lat_lng": "string",
      "date_of_birth": "string",
      "description": "string",
      "gender": "Male",
      "website": "https://example.com",
      "avatar": "string",
      "cover": "string",
      "ext_id": "string",
      "tags": [],
      "reputation": 1,
      "connection_status": "followed",
      "followings_counter": 0,
      "followers_counter": 0,
      "posts_counter": 0,
      "discussions_counter": 0,
      "statuses_counter": 0,
      "polls_counter": 0
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none User

Get Category's Feed

Code samples

# You can also use wget
curl -X GET /api/v2/category/{id}/feed/ \
  -H 'Accept: application/json'
  -H 'Authorization: Bearer {access_token}'
const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/category/{id}/feed/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieves the category feed.

HTTP Request

GET /api/v2/category/{id}/feed/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this Category.
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.
ordering query string false The ordering of the feed. Default to stream_order_by field in Category object
Enumerated Values
Parameter Value Description
» ordering recent Order by recent creation datetime
» ordering last_activity Order by last activity in the Feed object

Example responses

200 Response

{
  "count": 123,
  "next": "http://api.example.org/accounts/?offset=400&limit=100",
  "previous": "http://api.example.org/accounts/?offset=200&limit=100",
  "results": [
    {
      "type": "discussion",
      "discussion": {
        "id": 0,
        "categories": [
            {
                "id": 0,
                "tags": [],
                "order": 123,
                "name": "string",
                "name_synonyms": "string",
                "slug": "string",
                "slogan": "string",
                "html_info": "string",
                "seo_title": "string",
                "seo_description": "string",
                "auto_follow": "string",
                "active": true,
                "deleted": false,
                "image_original": "string",
                "image_bigger": "string",
                "image_big": "string",
                "image_medium": "string",
                "image_small": "string",
                "emotional_image_original": "string",
                "emotional_image_position": 123,
                "lastmod_datetime": "2019-08-24T14:15:22Z",
                "stream_order_by": "string",
            }
        ],
        "media_type": "images",
        "medias": [
            {
                "id": 0,
                "added_at": "2019-08-24T14:15:22Z",
                "type": "url",
                "title": "string",
                "description": "string",
                "url": "https://example.com",
                "image": "string",
                "image_width": 0,
                "image_height": 0,
                "order": 0,
                "embed": {
                    "id": 0,
                    "embed_type": "string",
                    "embed_id": "string",
                    "url": "string",
                    "metadata": {}
            }
          }
        ],
        "location": {
          "location": "string",
          "lat": 0,
          "lng": 0
        },
        "poll": {
          "id": 0,
          "title": "string",
          "multiple_choices": true,
          "added_at": "2019-08-24T14:15:22Z",
          "modified_at": "2019-08-24T14:15:22Z",
          "closed": true,
          "expiration_at": "2019-08-24T14:15:22Z",
          "hidden": "string",
          "choices": [
            {
              "id": 0,
              "choice": "string",
              "order": 0,
              "added_at": "2019-08-24T14:15:22Z",
              "deleted": "string",
              "vote_count": 0,
              "voted": true
            }
          ]
        },
        "last_activity_at": "2019-08-24T14:15:22Z",
        "author": {
          "id": 0,
          "username": "string",
          "real_name": "string",
          "date_joined": "2019-08-24T14:15:22Z",
          "bio": "string",
          "location": "string",
          "location_lat_lng": "string",
          "position_lat_lng": "string",
          "date_of_birth": "string",
          "description": "string",
          "gender": "Male",
          "website": "https://example.com",
          "avatar": "string",
          "cover": "string",
          "ext_id": "string",
          "tags": [
            {
              "id": 0,
              "active": true,
              "type": "user",
              "name": "string",
              "description": "string",
              "color": "string",
              "visible": true,
              "deleted": true,
              "created_at": "2019-08-24T14:15:22Z"
            }
          ],
          "reputation": 1,
          "followings_counter": 1,
          "followers_counter": 1,
          "posts_counter": 2,
          "discussions_counter": 5,
          "statuses_counter": 1,
          "polls_counter": 7
        },
        "added_at": "2019-08-24T14:15:22Z",
        "html": "string",
        "summary": "string",
        "deleted": true,
        "collapsed": false,
        "comment_count": 0,
        "vote_count": 0,
        "voted": false,
        "flag_count": 0,
        "share_count": 0,
        "addressing": [],
        "title": "string",
        "slug": "string",
        "view_count": 0,
        "follower_count": "string"
      },
      "seen_by_id": [
        0
      ],
      "has_boost": false,
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer false none Total results count
» next string(uri)¦null false none Next page url
» previous string(uri)¦null false none Previous page url
» results [Feed] false none List of results

Code samples

# You can also use wget
curl -X GET /api/v2/category/{id}/feed/trending/ \
  -H 'Accept: application/json'
  -H 'Authorization: Bearer {access_token}'
const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/category/{id}/feed/trending/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieves the category trending feed.

HTTP Request

GET /api/v2/category/{id}/feed/trending/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this Category.
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.

Example responses

200 Response

{
  "count": 123,
  "next": "string(uri)",
  "previous": "string(uri)",
  "results": [
    {
      "type": "discussion",
      "discussion": {
          "id": 1,
          "categories": [ 
              {
                    "id": 0,
                    "tags": [],
                    "order": 123,
                    "name": "string",
                    "name_synonyms": "string",
                    "slug": "string",
                    "slogan": "string",
                    "html_info": "string",
                    "seo_title": "string",
                    "seo_description": "string",
                    "auto_follow": "string",
                    "active": true,
                    "deleted": false,
                    "image_original": "string",
                    "image_bigger": "string",
                    "image_big": "string",
                    "image_medium": "string",
                    "image_small": "string",
                    "emotional_image_original": "string",
                    "emotional_image_position": 123,
                    "lastmod_datetime": "2019-08-24T14:15:22Z",
                    "stream_order_by": "string",
              }
                    ],
      "media_type": "images",
      "medias": [
        0
      ],
      "location": {
        "location": "string",
        "lat": 0,
        "lng": 0
      },
      "poll": {
        "id": 0,
        "title": "string",
        "multiple_choices": true,
        "added_at": "2019-08-24T14:15:22Z",
        "modified_at": "2019-08-24T14:15:22Z",
        "closed": true,
        "expiration_at": "2019-08-24T14:15:22Z",
        "hidden": "string",
        "choices": [
          {
            "id": 0,
            "choice": "string",
            "order": 0,
            "added_at": "2019-08-24T14:15:22Z",
            "deleted": "string",
            "vote_count": 0,
            "voted": true
          }
        ]
      },
      "last_activity_at": "2019-08-24T14:15:22Z",
        "author": {
          "id": 0,
          "username": "string",
          "real_name": "string",
          "date_joined": "2019-08-24T14:15:22Z",
          "bio": "string",
          "location": "string",
          "location_lat_lng": "string",
          "position_lat_lng": "string",
          "date_of_birth": "string",
          "description": "string",
          "gender": "Male",
          "website": "https://example.com",
          "avatar": "string",
          "cover": "string",
          "ext_id": "string",
          "tags": [
            {
              "id": 0,
              "active": true,
              "type": "user",
              "name": "string",
              "description": "string",
              "color": "string",
              "visible": true,
              "deleted": true,
              "created_at": "2019-08-24T14:15:22Z"
            }
          ],
        "reputation": 111,
        "followings_counter": 1,
        "followers_counter": 1,
        "posts_counter": 2,
        "discussions_counter": 5,
        "statuses_counter": 1,
        "polls_counter": 7
        },
        "added_at": "2019-08-24T14:15:22Z",
        "html": "string",
        "summary": "string",
        "deleted": true,
        "collapsed": false,
        "comment_count": 1,
        "vote_count": 0,
        "voted": false,
        "flag_count": 0,
        "share_count": 0,
        "addressing": [0],
        "title": "string",
        "slug": "string",
        "view_count": 0,
        "follower_count": 0
    },
    "seen_by_id": [
        170,
        115
    ],
    "has_boost": false
}

Responses

Status Meaning Description Schema
200 OK none Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer false none Total results count
» next string(uri)¦null false none Next page url
» previous string(uri)¦null false none Previous page url
» results [Discussion] false none List of results

Code samples

# You can also use wget
curl -X GET /api/v2/category/{id}/followers/trending/ \
  -H 'Accept: application/json'
  -H 'Authorization: Bearer {access_token}'
const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/category/{id}/followers/trending/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint returns all trending followers of a specific category during last n days (default 90) .

HTTP Request

GET /api/v2/category/{id}/followers/trending/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this Category.
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.
days query integer false Number of days (default 90 days).

Example responses

200 Response

{
  "count": 123,
  "next": "string(uri)",
  "previous": "string(uri)",
  "results": [
    {
      "id": 0,
      "username": "string",
      "real_name": "string",
      "date_joined": "2019-08-24T14:15:22Z",
      "bio": "string",
      "location": "string",
      "location_lat_lng": "string",
      "position_lat_lng": "string",
      "date_of_birth": "string",
      "description": "string",
      "gender": "Male",
      "website": "https://example.com",
      "avatar": "string",
      "cover": "string",
      "ext_id": "string",
      "tags": [],
      "reputation": 111,
      "connection_status": "followed",
      "followings_counter": 1,
      "followers_counter": 1,
      "posts_counter": 2,
      "discussions_counter": 5,
      "statuses_counter": 1,
      "polls_counter": 7
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none User

Follow a Category

Code samples

# You can also use wget
curl -X POST /api/v2/category/{id}/follow/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json'
  -H 'Authorization: Bearer {access_token}'
const inputBody = 'null';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/category/{id}/follow/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint follow a category.

HTTP Request

POST /api/v2/category/{id}/follow/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this Category.

Responses

Status Meaning Description Schema
204 No Content none None

Unfollow a Category

Code samples

# You can also use wget
curl -X POST /api/v2/category/{id}/follow/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json'
  -H 'Authorization: Bearer {access_token}'
const inputBody = 'null';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/category/{id}/follow/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint unfollow a category.

HTTP Request

POST /api/v2/category/{id}/follow/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this Category.

Responses

Status Meaning Description Schema
204 No Content none None

Get Followed Categories

Code samples

# You can also use wget
curl -X GET /api/v2/category/followed/ \
  -H 'Accept: application/json'
  -H 'Authorization: Bearer {access_token}'
const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/category/followed/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieves all followed categories by the user.

HTTP Request

GET /api/v2/category/followed/

Parameters

Name In Type Required Description
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.
search query string false A search term.
active query string false Filter using field active.
deleted query string false Filter using field deleted.

Example responses

200 Response

{
  "count": 123,
  "next": "string(uri)",
  "previous": "string(uri)",
  "results": [
    {
      "id": 0,
      "tags": [],
      "order": 123,
      "name": "string",
      "name_synonyms": "string",
      "slug": "string",
      "slogan": "string",
      "html_info": "string",
      "seo_title": "string",
      "seo_description": "string",
      "auto_follow": "string",
      "active": true,
      "deleted": false,
      "image_original": "string",
      "image_bigger": "string",
      "image_big": "string",
      "image_medium": "string",
      "image_small": "string",
      "emotional_image_original": "string",
      "emotional_image_position": 123,
      "lastmod_datetime": "2019-08-24T14:15:22Z",
      "stream_order_by": "string",
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer false none Total results count
» next string(uri)¦null false none Next page url
» previous string(uri)¦null false none Previous page url
» results list(Category) false none List of results

Embed

Get All Embeds

Code samples

# You can also use wget
curl -X GET /api/v2/embed/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}'


const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/embed/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieves all embeds.

HTTP Request

GET /api/v2/embed/

Parameters

Name In Type Required Description
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.

Example responses

200 Response

{
  "count": 123,
  "next": "http://api.example.org/accounts/?offset=400&limit=100",
  "previous": "http://api.example.org/accounts/?offset=200&limit=100",
  "results": [
    {
      "id": 0,
      "embed_type": "string",
      "embed_id": "string",
      "url": "https://example.com",
      "metadata": {}
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer false none none
» next string(uri)¦null false none none
» previous string(uri)¦null false none none
» results list(Embed) false none none

Create an Embed

Code samples

# You can also use wget
curl -X POST /api/v2/embed/ \
  --H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}' \
  --data-raw '{
    "embed_type": "string",
    "embed_id": "string",
    "url": "https://example.com",
    "metadata": {}
}'

const inputBody = '{
  "embed_type": "string",
  "embed_id": "string",
  "url": "https://example.com",
  "metadata": {}
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/embed/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint create an Embed.

HTTP Request

POST /api/v2/embed/

Body parameter

{
  "embed_type": "string",
  "embed_id": "string",
  "url": "https://example.com",
  "metadata": {}
}

Parameters

Name In Type Required Description
» id body integer false none
» embed_type body string true Type of the embed, can be any string except sc_vimeo or sc_link that are used for embedded objects auomatically created by the community
» embed_id body string true External id for the embed object
» url body string(uri)¦null false Url for the resource, if any
» metadata body json false Metadata associated to this embed. It mus be a valid json object

Example responses

201 Response

{
  "id": 0,
  "embed_type": "string",
  "embed_id": "string",
  "url": "https://example.com",
  "metadata": {}
}

Responses

Status Meaning Description Schema
201 Created none Embed

Search an Embed

Code samples

# You can also use wget
curl -X GET /api/v2/embed/search/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}'


const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/embed/search/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint perform search to Embeds

HTTP Request

GET /api/v2/embed/search/

Parameters

Name In Type Required Description
embed_type query string false embed_type
embed_id query string false embed_id
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.

Example responses

200 Response

{
  "count": 123,
  "next": "http://api.example.org/accounts/?offset=400&limit=100",
  "previous": "http://api.example.org/accounts/?offset=200&limit=100",
  "results": [
    {
      "id": 0,
      "embed_type": "string",
      "embed_id": "string",
      "url": "https://example.com",
      "metadata": {}
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer false none none
» next string(uri)¦null false none none
» previous string(uri)¦null false none none
» results list(Embed) false none none

Get a specific Embed

Code samples

# You can also use wget
curl -X GET /api/v2/embed/{id}/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}'


const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/embed/{id}/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieves a specific embed using ID.

HTTP Request

GET /api/v2/embed/{id}/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this embed.

Example responses

200 Response

{
  "id": 0,
  "embed_type": "string",
  "embed_id": "string",
  "url": "https://example.com",
  "metadata": {}
}

Responses

Status Meaning Description Schema
200 OK none Embed

Update a specific Embed

Code samples

# You can also use wget
curl -X PUT /api/v2/embed/{id}/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}' \
  --data-raw '{
    "url": "https://example.com",
    "metadata": {}
  }'

const inputBody = '{
  "url": "https://example.com",
  "metadata": {}
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/embed/{id}/',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint update a specific Embed.

HTTP Request

PUT /api/v2/embed/{id}/

Body parameter

{
  "url": "https://example.com",
  "metadata": {}
}

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this embed.
» url string(uri)¦null false none Url for the resource, if any
» metadata json false none Metadata associated to this embed. It mus be a valid json object

Example responses

200 Response

{
  "id": 0,
  "embed_type": "string",
  "embed_id": "string",
  "url": "https://example.com",
  "metadata": {}
}

Responses

Status Meaning Description Schema
200 OK none UpdateEmbed

Patch a Specific Embed

Code samples

# You can also use wget
curl -X PATCH /api/v2/embed/{id}/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}' \
  --data-raw '{
    "url": "https://example.com"
  }'

const inputBody = '{
  "url": "https://example.com",
  "metadata": {}
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/embed/{id}/',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint patch a specific endpoint.

NOTE: You can use this endpoint to edit a single field passing only the id and the needed field (without mandatory fields).

HTTP Request

PATCH /api/v2/embed/{id}/

Body parameter

{
  "url": "https://example.com",
  "metadata": {}
}

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this embed.
» url string(uri)¦null false none Url for the resource, if any
» metadata json false none Metadata associated to this embed. It mus be a valid json object

Example responses

200 Response

{
  "id": 0,
  "embed_type": "string",
  "embed_id": "string",
  "url": "https://example.com",
  "metadata": {}
}

Responses

Status Meaning Description Schema
200 OK none UpdateEmbed

Get a specific Embed's Feed

Code samples

# You can also use wget
curl -X GET /api/v2/embed/{id}/feed/ \
  -H 'Accept: application/json'
  -H 'Authorization: Bearer {access_token}'
const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/embed/{id}/feed/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieves the embed's feed witch contains Feed that has the Embed as associated media.

HTTP Request

GET /api/v2/embed/{id}/feed/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this Category.
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.
ordering query string false The ordering of the feed. Default to 'recent'
Enumerated Values
Parameter Value Description
» ordering recent Order by recent creation datetime
» ordering last_activity Order by last activity in the Feed object

Example responses

200 Response

{
  "count": 123,
  "next": "http://api.example.org/accounts/?offset=400&limit=100",
  "previous": "http://api.example.org/accounts/?offset=200&limit=100",
  "results": [
    {
      "type": "discussion",
      "discussion": {
        "id": 0,
        "categories": [
            {
                "id": 0,
                "tags": [],
                "order": 123,
                "name": "string",
                "name_synonyms": "string",
                "slug": "string",
                "slogan": "string",
                "html_info": "string",
                "seo_title": "string",
                "seo_description": "string",
                "auto_follow": "string",
                "active": true,
                "deleted": false,
                "image_original": "string",
                "image_bigger": "string",
                "image_big": "string",
                "image_medium": "string",
                "image_small": "string",
                "emotional_image_original": "string",
                "emotional_image_position": 123,
                "lastmod_datetime": "2019-08-24T14:15:22Z",
                "stream_order_by": "string",
            }
        ],
        "media_type": "images",
        "medias": [
            {
                "id": 0,
                "added_at": "2019-08-24T14:15:22Z",
                "type": "url",
                "title": "string",
                "description": "string",
                "url": "https://example.com",
                "image": "string",
                "image_width": 0,
                "image_height": 0,
                "order": 0,
                "embed": {
                    "id": 0,
                    "embed_type": "string",
                    "embed_id": "string",
                    "url": "string",
                    "metadata": {}
            }
          }
        ],
        "location": {
          "location": "string",
          "lat": 0,
          "lng": 0
        },
        "poll": {
          "id": 0,
          "title": "string",
          "multiple_choices": true,
          "added_at": "2019-08-24T14:15:22Z",
          "modified_at": "2019-08-24T14:15:22Z",
          "closed": true,
          "expiration_at": "2019-08-24T14:15:22Z",
          "hidden": "string",
          "choices": [
            {
              "id": 0,
              "choice": "string",
              "order": 0,
              "added_at": "2019-08-24T14:15:22Z",
              "deleted": "string",
              "vote_count": 0,
              "voted": true
            }
          ]
        },
        "last_activity_at": "2019-08-24T14:15:22Z",
        "author": {
          "id": 0,
          "username": "string",
          "real_name": "string",
          "date_joined": "2019-08-24T14:15:22Z",
          "bio": "string",
          "location": "string",
          "location_lat_lng": "string",
          "position_lat_lng": "string",
          "date_of_birth": "string",
          "description": "string",
          "gender": "Male",
          "website": "https://example.com",
          "avatar": "string",
          "cover": "string",
          "ext_id": "string",
          "tags": [
            {
              "id": 0,
              "active": true,
              "type": "user",
              "name": "string",
              "description": "string",
              "color": "string",
              "visible": true,
              "deleted": true,
              "created_at": "2019-08-24T14:15:22Z"
            }
          ],
        "reputation": 111,
        "followings_counter": 1,
        "followers_counter": 1,
        "posts_counter": 2,
        "discussions_counter": 5,
        "statuses_counter": 1,
        "polls_counter": 7

        },
        "added_at": "2019-08-24T14:15:22Z",
        "html": "string",
        "summary": "string",
        "deleted": true,
        "collapsed": false,
        "comment_count": 1,
        "vote_count": 0,
        "voted": false,
        "flag_count": 0,
        "share_count": 0,
        "addressing": [0],
        "title": "string",
        "slug": "string",
        "view_count": 0,
        "follower_count": 0
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer false none Total results count
» next string(uri)¦null false none Next page url
» previous string(uri)¦null false none Previous page url
» results [Feed] false none List of results

Get Embed's Feed

Code samples

# You can also use wget
curl -X GET /api/v2/embed/feed/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}'


const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/embed/feed/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieves the embed's feed witch contains Feed that has an Embed as associated media.

If the tuple embed_type embed_id is passed as parameter retrieves a list of Feed that has Embed as associated media like the Get a specific Embed's Feed API.

HTTP Request

GET /api/v2/embed/feed/

Parameters

Name In Type Required Description
embed_type query string false embed_type
embed_id query string false embed_id
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.
ordering query string false The ordering of the feed. Default to 'recent'
Enumerated Values
Parameter Value Description
» ordering recent Order by recent creation datetime
» ordering last_activity Order by last activity in the Feed object

Example responses

200 Response

{
  "count": 123,
  "next": "http://api.example.org/accounts/?offset=400&limit=100",
  "previous": "http://api.example.org/accounts/?offset=200&limit=100",
  "results": [
    {
      "type": "discussion",
      "discussion": {
        "id": 0,
        "categories": [
            {
                "id": 0,
                "tags": [],
                "order": 123,
                "name": "string",
                "name_synonyms": "string",
                "slug": "string",
                "slogan": "string",
                "html_info": "string",
                "seo_title": "string",
                "seo_description": "string",
                "auto_follow": "string",
                "active": true,
                "deleted": false,
                "image_original": "string",
                "image_bigger": "string",
                "image_big": "string",
                "image_medium": "string",
                "image_small": "string",
                "emotional_image_original": "string",
                "emotional_image_position": 123,
                "lastmod_datetime": "2019-08-24T14:15:22Z",
                "stream_order_by": "string",
            }
        ],
        "media_type": "images",
        "medias": [
            {
                "id": 0,
                "added_at": "2019-08-24T14:15:22Z",
                "type": "url",
                "title": "string",
                "description": "string",
                "url": "https://example.com",
                "image": "string",
                "image_width": 0,
                "image_height": 0,
                "order": 0,
                "embed": {
                    "id": 0,
                    "embed_type": "string",
                    "embed_id": "string",
                    "url": "string",
                    "metadata": {}
            }
          }
        ],
        "location": {
          "location": "string",
          "lat": 0,
          "lng": 0
        },
        "poll": {
          "id": 0,
          "title": "string",
          "multiple_choices": true,
          "added_at": "2019-08-24T14:15:22Z",
          "modified_at": "2019-08-24T14:15:22Z",
          "closed": true,
          "expiration_at": "2019-08-24T14:15:22Z",
          "hidden": "string",
          "choices": [
            {
              "id": 0,
              "choice": "string",
              "order": 0,
              "added_at": "2019-08-24T14:15:22Z",
              "deleted": false,
              "vote_count": 0,
              "voted": true
            }
          ],
          "votes": [
            {
              "id": 0,
              "choice": "string",
              "user": "string"
            }
          ]
        },
        "last_activity_at": "2019-08-24T14:15:22Z",
        "author": {
          "id": 0,
          "username": "string",
          "real_name": "string",
          "date_joined": "2019-08-24T14:15:22Z",
          "bio": "string",
          "location": "string",
          "location_lat_lng": "string",
          "position_lat_lng": "string",
          "date_of_birth": "string",
          "description": "string",
          "gender": "Male",
          "website": "https://example.com",
          "avatar": "string",
          "cover": "string",
          "ext_id": "string",
          "tags": [
            {
              "id": 0,
              "active": true,
              "type": "user",
              "name": "string",
              "description": "string",
              "color": "string",
              "visible": true,
              "deleted": true,
              "created_at": "2019-08-24T14:15:22Z"
            }
          ],
        "reputation": 111,
        "followings_counter": 1,
        "followers_counter": 1,
        "posts_counter": 2,
        "discussions_counter": 5,
        "statuses_counter": 1,
        "polls_counter": 7
        },
        "added_at": "2019-08-24T14:15:22Z",
        "html": "string",
        "summary": "string",
        "deleted": true,
        "collapsed": false,
        "comment_count": 1,
        "vote_count": 0,
        "voted": false,
        "flag_count": 0,
        "share_count": 0,
        "addressing": [0],
        "title": "string",
        "slug": "string",
        "view_count": 0,
        "follower_count": 0
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer false none none
» next string(uri)¦null false none none
» previous string(uri)¦null false none none
» results list(Feed) false none none

Media

Chunk Upload Media

Code samples

# You can also use wget
curl -X POST /api/v2/media/upload/chunk/ \
  -H 'Content-Type: multipart/form-data' \
  -H 'Content-Range: bytes 1433600-1638399/2124437' \
  -H 'Accept: application/json' \
  -H "Transfer-Encoding: chunked" \
  -H "Authorization: Bearer {access_token}"
  --data-binary $'------WebKitFormBoundaryT4U3VeMJUOwfER55\r\nContent-Disposition: form-data; name="image"; filename="p.gif"\r\nContent-Type: image/gif\r\n\r\n\r\n------WebKitFormBoundaryT4U3VeMJUOwfER55--\r\n' \
  --compressed
const inputBody = '{
  "upload_id": "string",
  "offset": "string",
  "image": "blob"
}';
const headers = {
  'Content-Type':'multipart/form-data',
  'Content-Range': 'bytes 1433600-1638399/2124437',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/media/upload/chunk/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint perform the chunk upload of a media with type image or document. The client must split the file into chunks and send to the server in series. After all the chunks have been uploaded the client must call the Chunk Upload Complete endpoint with the given upload_id parameter to finalize the upload and retrieve the Media.

To perform chunk upload the request must contain Content-Range header with the information about the chunk.

Max file size for image file is 5M.

Max file size for document file is 50M.

Max chunk size is 204800 bytes.

HTTP Request

POST /api/v2/media/upload/chunk/

Body parameter

{
  "upload_id": "string",
  "offset": "string"
}

Parameters

Name In Type Required Description
» Content-Range header string true range of the chunk upload in the format bytes start-end/total
» upload_id body string true returned by the first call and required from the second
» expires body string false expiration time
» image body blob false Image chunk to be uploaded
» document body blob false Document chunk to be uploaded

Example responses

201 Response

{
  "upload_id": "string",
  "offset": "string",
  "expires": "string"
}

Responses

Status Meaning Description Schema
201 Created none ChunkMedia

Chunk Upload Media Complete

Code samples

# You can also use wget
curl -X POST /api/v2/media/upload/complete/ \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}' \
  --data-raw 'upload_id=UPLOAD_ID&md5=FILE_MD5' \
const inputBody = '{
  "type": "image",
  "upload_id": "string",
  "md5": "string"
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/media/upload/complete/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint complete the chunk upload and create the Media.

HTTP Request

POST /api/v2/media/upload/complete/

Body parameter

{
  "type": "image",
  "upload_id": "string",
  "md5": "string"
}

Parameters

Name In Type Required Description
» type body string false Default to image or document based on file extension
» upload_id body string true Id of the chunk uploaded file
» md5 body string true MD5 hash of the original file for checksum proposal
Enumerated Values
Parameter Value Description
» type image Image media type
» type doc Document media type (only pdf documents are supported)
» type eimage Other images related to contributes. eg. Images uploaded and inserted as <img> into the contribute text

Example responses

201 Response

{
  "id": 0,
  "added_at": "2019-08-24T14:15:22Z",
  "type": "image",
  "title": null,
  "description": null,
  "url": null,
  "image": "string",
  "image_width": 0,
  "image_height": 0,
  "order": 0,
  "embed": null
}

Responses

Status Meaning Description Schema
201 Created none Media

Create a Media

Code samples

# You can also use wget
curl -X POST /api/v2/media/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}' \
  --data-raw '{
    "type": "url",
    "url": "https://example.com"
  }'

const inputBody = '{
  "type": "url",
  "url": "https://example.com",
  "embed": null
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/media/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint create a Media. The allowed types for this endpoint are:

If embed parameter are set and no Embed with embed_type - embed_id are in the community database this endpoint create an Embed object with the metadata passed.

HTTP Request

POST /api/v2/media/

Body parameter

{
  "type": "url",
  "url": "https://example.com",
  "embed": {
    "id": 0,
    "embed_type": "string",
    "embed_id": "string",
    "url": "https://example.com",
    "metadata": {}
  }
}

Parameters

Name In Type Required Description
» type body string true none
» url body string(uri) if type is url Required for type url
» shared_object body integer if type is share Required for type share
» embed body Embed if type is embed none
Enumerated Values
Parameter Value Description
» type vimeo Vimeo video media type
» type url Url media type (used for any webpages, youtube or vimeo public videos)
» type embed External resource

Example responses

201 Response

{
  "id": 0,
  "added_at": "2019-08-24T14:15:22Z",
  "type": "vimeo",
  "title": "string",
  "description": "string",
  "url": "https://example.com",
  "image": "string",
  "image_width": 0,
  "image_height": 0,
  "order": 0,
  "embed": {
    "id": 0,
    "embed_type": "string",
    "embed_id": "string",
    "url": "string",
    "metadata": {}
  }
}

Responses

Status Meaning Description Schema
201 Created none Media

Get a specific Media

Code samples

# You can also use wget
curl -X GET /api/v2/media/{id}/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}'

const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/media/{id}/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieves a specific media using ID.

HTTP Request

GET /api/v2/media/{id}/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this media.

Example responses

200 Response

{
  "id": 0,
  "added_at": "2019-08-24T14:15:22Z",
  "type": "vimeo",
  "title": "string",
  "description": "string",
  "url": "https://example.com",
  "image": "string",
  "image_width": 0,
  "image_height": 0,
  "order": 0,
  "embed": {
    "id": 0,
    "embed_type": "string",
    "embed_id": "string",
    "url": "string",
    "metadata": {}
  }
}

Responses

Status Meaning Description Schema
200 OK none Media

Update a Media

Code samples

# You can also use wget
curl -X PUT /api/v2/media/{id}/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}' \
  --data-raw '{
    "image": "https://example.com"
  }'

const inputBody = '{
  "image": "https://example.com"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/media/{id}/',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint update a Media. It must be used for media of type url for set the preview image that can be choosed between the images returned by the create endpoint or other images that can be retrieved by an url.

HTTP Request

PUT /api/v2/media/{id}/

Body parameter

{
  "image": "https://example.com"
}

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this media object.
» image body string(uri) true Image url

Example responses

200 Response

{
  "id": 0,
  "added_at": "2019-08-24T14:15:22Z",
  "type": "vimeo",
  "title": "string",
  "description": "string",
  "url": "https://example.com",
  "image": "string",
  "image_width": 0,
  "image_height": 0,
  "order": 0,
  "embed": {
    "id": 0,
    "embed_type": "string",
    "embed_id": "string",
    "url": "string",
    "metadata": {}
  }
}

Responses

Status Meaning Description Schema
200 OK none Media

Delete a Media

Code samples

# You can also use wget
curl -X DELETE /api/v2/media/{id}/ \
  -H 'Authorization: Bearer {access_token}'

fetch('/api/v2/media/{id}/',
{
  method: 'DELETE'
  headers: {'Authorization': 'Bearer {access_token}'}
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint delete a Media.

HTTP Request

DELETE /api/v2/media/{id}/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this media object.

Responses

Status Meaning Description Schema
204 No Content none None

Mention

How it works

The mentions mechanism is used to allow users to mention some other users within the content they write (posts, discussions, status, comments, etc.). The presence of a mention within a contribution causes a notification to be sent to the mentioned user.

When creating or editing a contribution

To mention another user, one or more usernames preceded by the special character @ must be present in the text field when creating or updating a contribution, for example:

{ "post": 20, "text": "This is a comment with some mentions to notify @username1 and @username2" }

Note that usernames may need to be auto-completed searchable in the contribution creation or editing interface (starting typing after the @ special character).

While reading a contribution

Retrieving a contribution that contains a mention to one or more users you will find in the text field one or more html tags that indicate the position and details (user ids) of the mention and which must be made as links pointing to the user profiles mentioned, to example:

{ "html": "This is a comment with some mentions to notify <mention extid=\"301\" id=\"15\">@username1</mention> and <mention extid=\"302\" id=\"16\">@username2</mention>", "summary": "This is a comment with some mentions to notify @username1 and @username2" }

Note that the summary field also contains information about the mention.

Discussion

Get All Discussions

Code samples

# You can also use wget
curl -X GET /api/v2/discussion/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}'

const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/discussion/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieves all discussions.

HTTP Request

GET /api/v2/discussion/

Parameters

Name In Type Required Description
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.
ordering query string false Which field to use when ordering the results. For sorting desc use - in front of the field name. Default to -added_at. Available values are added_at, last_activity_at

Example responses

200 Response

{
  "count": 123,
  "next": "string",
  "previous": "string",
  "results": [
    {
      "id": 0,
      "categories": [
        {
          "id": 0,
          "tags": [],
          "order": 123,
          "name": "string",
          "name_synonyms": "string",
          "slug": "string",
          "slogan": "string",
          "html_info": "string",
          "seo_title": "string",
          "seo_description": "string",
          "auto_follow": "string",
          "active": true,
          "deleted": false,
          "image_original": "string",
          "image_bigger": "string",
          "image_big": "string",
          "image_medium": "string",
          "image_small": "string",
          "emotional_image_original": "string",
          "emotional_image_position": 123,
          "lastmod_datetime": "2019-08-24T14:15:22Z",
          "stream_order_by": "string",
        }
      ],
      "medias": [
        {
          "id": 0,
          "added_at": "2019-08-24T14:15:22Z",
          "type": "url",
          "title": "string",
          "description": "string",
          "url": "https://example.com",
          "image": "string",
          "image_width": 0,
          "image_height": 0,
          "order": 0,
          "embed": {
            "id": 0,
            "embed_type": "string",
            "embed_id": "string",
            "url": "string",
            "metadata": {}
          }
        }
      ],
      "location": {
        "location": "string",
        "lat": 0,
        "lng": 0
      },
      "poll": {
        "id": 0,
        "title": "string",
        "multiple_choices": true,
        "added_at": "2019-08-24T14:15:22Z",
        "modified_at": "2019-08-24T14:15:22Z",
        "closed": true,
        "expiration_at": "2019-08-24T14:15:22Z",
        "hidden": false,
        "choices": [
          {
            "id": 0,
            "choice": "string",
            "order": 0,
            "added_at": "2019-08-24T14:15:22Z",
            "deleted": "string",
            "vote_count": 0,
            "voted": true
          }
        ]
      },
      "last_activity_at": "2019-08-24T14:15:22Z",
      "author": {
        "id": 0,
        "username": "string",
        "real_name": "string",
        "date_joined": "2019-08-24T14:15:22Z",
        "bio": "string",
        "location": "string",
        "location_lat_lng": "string",
        "position_lat_lng": "string",
        "date_of_birth": "string",
        "description": "string",
        "gender": "Male",
        "website": "https://example.com",
        "avatar": "string",
        "cover": "string",
        "ext_id": "string",
        "tags": [],
        "reputation": 111,
        "followings_counter": 1,
        "followers_counter": 1,
        "posts_counter": 2,
        "discussions_counter": 4,
        "statuses_counter": 1,
        "polls_counter": 6
      },
      "added_at": "2019-08-24T14:15:22Z",
      "html": "string",
      "summary": "string",
      "deleted": true,
      "collapsed": false,
      "comment_count": 0,
      "vote_count": "string",
      "voted": false,
      "flag_count": 0,
      "share_count": 0,
      "addressing": [],
      "title": "string",
      "slug": "string",
      "view_count": 1,
      "follower_count": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer true none Total results count
» next string¦null false none Next page url
» previous string¦null false none Previous page url
» results list(Discussion) true none List of results

Get All Uncommented Discussions

Code samples

# You can also use wget
curl -X GET /api/v2/discussion/uncommented/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}'

const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/discussion/uncommented/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieves all uncommented discussions.

HTTP Request

GET /api/v2/discussion/uncommented/

Parameters

Name In Type Required Description
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.

Example responses

200 Response

{
{
  "count": 123,
  "next": "string",
  "previous": "string",
  "results": [
    {
      "id": 0,
      "categories": [
        {
          "id": 0,
          "tags": [],
          "order": 123,
          "name": "string",
          "name_synonyms": "string",
          "slug": "string",
          "slogan": "string",
          "html_info": "string",
          "seo_title": "string",
          "seo_description": "string",
          "auto_follow": "string",
          "active": true,
          "deleted": false,
          "image_original": "string",
          "image_bigger": "string",
          "image_big": "string",
          "image_medium": "string",
          "image_small": "string",
          "emotional_image_original": "string",
          "emotional_image_position": 123,
          "lastmod_datetime": "2019-08-24T14:15:22Z",
          "stream_order_by": "string",
        }
      ],
      "medias": [
        {
          "id": 0,
          "added_at": "2019-08-24T14:15:22Z",
          "type": "url",
          "title": "string",
          "description": "string",
          "url": "https://example.com",
          "image": "string",
          "image_width": 0,
          "image_height": 0,
          "order": 0,
          "embed": {
            "id": 0,
            "embed_type": "string",
            "embed_id": "string",
            "url": "string",
            "metadata": {}
          }
        }
      ],
      "location": {
        "location": "string",
        "lat": 0,
        "lng": 0
      },
      "poll": {
        "id": 0,
        "title": "string",
        "multiple_choices": true,
        "added_at": "2019-08-24T14:15:22Z",
        "modified_at": "2019-08-24T14:15:22Z",
        "closed": true,
        "expiration_at": "2019-08-24T14:15:22Z",
        "hidden": false,
        "choices": [
          {
            "id": 0,
            "choice": "string",
            "order": 0,
            "added_at": "2019-08-24T14:15:22Z",
            "deleted": "string",
            "vote_count": 0,
            "voted": true
          }
        ]
      },
      "last_activity_at": "2019-08-24T14:15:22Z",
      "author": {
        "id": 0,
        "username": "string",
        "real_name": "string",
        "date_joined": "2019-08-24T14:15:22Z",
        "bio": "string",
        "location": "string",
        "location_lat_lng": "string",
        "position_lat_lng": "string",
        "date_of_birth": "string",
        "description": "string",
        "gender": "Male",
        "website": "https://example.com",
        "avatar": "string",
        "cover": "string",
        "ext_id": "string",
        "tags": [],
        "reputation": 111,
        "followings_counter": 1,
        "followers_counter": 1,
        "posts_counter": 2,
        "discussions_counter": 4,
        "statuses_counter": 1,
        "polls_counter": 6
      },
      "added_at": "2019-08-24T14:15:22Z",
      "html": "string",
      "summary": "string",
      "deleted": true,
      "collapsed": false,
      "comment_count": 0,
      "vote_count": "string",
      "voted": false,
      "flag_count": 0,
      "share_count": 0,
      "addressing": [],
      "title": "string",
      "slug": "string",
      "view_count": 1,
      "follower_count": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK none Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer true none Total results count
» next string¦null false none Next page url
» previous string¦null false none Previous page url
» results list(Discussion) true none List of results

Search a Discussion

Code samples

# You can also use wget
curl -X GET /api/v2/discussion/search/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}'

const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/discussion/search/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint perform search operation to discussions.

HTTP Request

GET /api/v2/discussion/search/

Parameters

Name In Type Required Description
search query string false A search term.

Example responses

200 Response

{
  "count": 123,
  "next": "string",
  "previous": "string",
  "results": [
      {
        "id": 0,
        "categories": [
          {
            "id": 0,
            "tags": [],
            "order": 123,
            "name": "string",
            "name_synonyms": "string",
            "slug": "string",
            "slogan": "string",
            "html_info": "string",
            "seo_title": "string",
            "seo_description": "string",
            "auto_follow": "string",
            "active": true,
            "deleted": false,
            "image_original": "string",
            "image_bigger": "string",
            "image_big": "string",
            "image_medium": "string",
            "image_small": "string",
            "emotional_image_original": "string",
            "emotional_image_position": 123,
            "lastmod_datetime": "2019-08-24T14:15:22Z",
            "stream_order_by": "string",
          }
        ],
        "medias": [
          {
            "id": 0,
            "added_at": "2019-08-24T14:15:22Z",
            "type": "url",
            "title": "string",
            "description": "string",
            "url": "https://example.com",
            "image": "string",
            "image_width": 0,
            "image_height": 0,
            "order": 0,
            "embed": {
              "id": 0,
              "embed_type": "string",
              "embed_id": "string",
              "url": "string",
              "metadata": {}
            }
          }
        ],
        "location": {
            "location": "string",
            "lat": 0,
            "lng": 0
        },
        "poll": {
            "id": 0,
            "title": "string",
            "multiple_choices": true,
            "added_at": "2019-08-24T14:15:22Z",
            "modified_at": "2019-08-24T14:15:22Z",
            "closed": true,
            "expiration_at": "2019-08-24T14:15:22Z",
            "hidden": "string",
            "choices": [
              {
                  "id": 0,
                  "choice": "string",
                  "order": 0,
                  "added_at": "2019-08-24T14:15:22Z",
                  "deleted": "string",
                  "vote_count": 0,
                  "voted": true
              }
            ]
        },
        "last_activity_at": "2019-08-24T14:15:22Z",
        "view_count": 0,
        "author": {
            "id": 0,
            "username": "string",
            "real_name": "string",
            "date_joined": "2019-08-24T14:15:22Z",
            "bio": "string",
            "location": "string",
            "location_lat_lng": "string",
            "position_lat_lng": "string",
            "date_of_birth": "string",
            "description": "string",
            "gender": "Male",
            "website": "https://example.com",
            "avatar": "string",
            "cover": "string",
            "ext_id": "string",
            "tags": [],
            "reputation": 111,
            "followings_counter": 1,
            "followers_counter": 1,
            "posts_counter": 2,
            "discussions_counter": 4,
            "statuses_counter": 1,
            "polls_counter": 6
        },
        "added_at": "2019-08-24T14:15:22Z",
        "html": "string",
        "summary": "string",
        "deleted": true,
        "collapsed": false,
        "comment_count": 0,
        "vote_count": "string",
        "voted": false,
        "flag_count": 0,
        "share_count": 0,
        "addressing": [],
        "title": "string",
        "slug": "string",
        "view_count": 1,
        "follower_count": "string",
        "matches": [
          {
            "object": {
                "id": 238,
                "type": "comment",
                "added_at": "2020-10-19T16:05:34.974676+00:00",
                "html": "string"
            },
            "author": {
              "id": 3,
              "username": "string",
              "real_name": "string",
              "date_joined": "2019-08-24T14:15:22Z",
              "bio": "string",
              "location": "string",
              "location_lat_lng": "string",
              "position_lat_lng": "string",
              "date_of_birth": "string",
              "description": "string",
              "gender": "Male",
              "website": "https://example.com",
              "avatar": "string",
              "cover": "string",
              "ext_id": "string",
              "tags": [],
              "reputation": 111,
              "followings_counter": 1,
              "followers_counter": 1,
              "posts_counter": 2,
              "discussions_counter": 4,
              "statuses_counter": 1,
              "polls_counter": 6
            }
          }
        ]
      }
    ]
}

Responses

Status Code 200

Name Type Required Restrictions Description
» count integer true none Total results count
» next string¦null false none Next page url
» previous string¦null false none Previous page url
» results list(SearchDiscussion) true none List of results

Create a Discussion

Code samples

# You can also use wget
curl -X POST /api/v2/discussion/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}' \
  --data-raw '{
    "title": "string",
    "text": "string",
    "categories": [0],
    "medias": [0],
    "location": {
      "location": "string",
      "lat": 0,
      "lng": 0
    },
    "poll": {
      "title": "string",
      "multiple_choices": true,
      "closed": true,
      "expiration_at": "2019-08-24T14:15:22Z",
      "choices": [
        {
          "choice": "string"
        }
      ]
    },
    "addressing": []
  }'
const inputBody = {
  "title": "string",
  "text": "string",
  "categories": [0],
  "medias": [0],
  "location": {
    "location": "string",
    "lat": 0,
    "lng": 0
  },
  "poll": {
    "title": "string",
    "multiple_choices": true,
    "closed": true,
    "expiration_at": "2019-08-24T14:15:22Z",
    "choices": [
      {
        "choice": "string"
      }
    ]
  },
  "addressing": []
};
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/discussion/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint creates a discussion.

HTTP Request

POST /api/v2/discussion/

Body parameter

{
  "title": "string",
  "text": "string",
  "categories": [0],
  "medias": [0],
  "location": {
    "location": "string",
    "lat": 0,
    "lng": 0
  },
  "poll": {
    "title": "string",
    "multiple_choices": true,
    "closed": true,
    "expiration_at": "2019-08-24T14:15:22Z",
    "choices": [
      {
        "choice": "string"
      }
    ]
  },
  "addressing": []
}

Parameters

Name In Type Required Description
» title body string¦null true The title of the discussion
» text body string false The content of the discussion in html format, it can contain some mentions
» categories body list(integer) true List of id of Category
» medias body list(integer) false List of id of Media
» location body object¦null false The Location object to associate at the discussion
»» location body string¦null true none
»» lat body number¦null true none
»» lng body number¦null true none
» poll body object¦null false The poll object to associate at the discussion
»» title body string true none
»» multiple_choices body boolean false none
»» expiration_at body string(date-time) false none
»» choices body list(object) true none
»»» choice body string true none
» addressing body list(integer) false List of id of Tag

Example responses

201 Response

{
  "id": 0,
  "categories": [
    {
      "id": 0,
      "tags": [],
      "order": 123,
      "name": "string",
      "name_synonyms": "string",
      "slug": "string",
      "slogan": "string",
      "html_info": "string",
      "seo_title": "string",
      "seo_description": "string",
      "auto_follow": "string",
      "active": true,
      "deleted": false,
      "image_original": "string",
      "image_bigger": "string",
      "image_big": "string",
      "image_medium": "string",
      "image_small": "string",
      "emotional_image_original": "string",
      "emotional_image_position": 123,
      "lastmod_datetime": "2019-08-24T14:15:22Z",
      "stream_order_by": "string",
    }
  ],
  "medias": [
    {
      "id": 0,
      "added_at": "2019-08-24T14:15:22Z",
      "type": "url",
      "title": "string",
      "description": "string",
      "url": "https://example.com",
      "image": "string",
      "image_width": 0,
      "image_height": 0,
      "order": 0,
      "embed": {
        "id": 0,
        "embed_type": "string",
        "embed_id": "string",
        "url": "string",
        "metadata": {}
      }
    }
  ],
  "location": {
    "location": "string",
    "lat": 0,
    "lng": 0
  },
  "poll": {
    "id": 0,
    "title": "string",
    "multiple_choices": true,
    "added_at": "2019-08-24T14:15:22Z",
    "modified_at": "2019-08-24T14:15:22Z",
    "closed": true,
    "expiration_at": "2019-08-24T14:15:22Z",
    "hidden": "string",
    "choices": [
      {
        "id": 0,
        "choice": "string",
        "order": 0,
        "added_at": "2019-08-24T14:15:22Z",
        "deleted": "string",
        "vote_count": 0,
        "voted": true
      }
    ]
  },
  "last_activity_at": "2019-08-24T14:15:22Z",
  "author": {
    "id": 0,
    "username": "string",
    "real_name": "string",
    "date_joined": "2019-08-24T14:15:22Z",
    "bio": "string",
    "location": "string",
    "location_lat_lng": "string",
    "position_lat_lng": "string",
    "date_of_birth": "string",
    "description": "string",
    "gender": "Male",
    "website": "https://example.com",
    "avatar": "string",
    "cover": "string",
    "ext_id": "string",
    "tags": [],
    "reputation": 111,
    "followings_counter": 1,
    "followers_counter": 1,
    "posts_counter": 2,
    "discussions_counter": 4,
    "statuses_counter": 1,
    "polls_counter": 6
  },
  "added_at": "2019-08-24T14:15:22Z",
  "html": "string",
  "summary": "string",
  "deleted": true,
  "collapsed": false,
  "comment_count": 0,
  "vote_count": "string",
  "voted": false,
  "flag_count": 0,
  "share_count": 0,
  "addressing": [],
  "title": "string",
  "slug": "string",
  "view_count": 1,
  "follower_count": "string"
}

Responses

Status Meaning Description Schema
201 Created none Discussion

Get a specific Discussion

Code samples

# You can also use wget
curl -X GET /api/v2/discussion/{id}/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}'

const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/discussion/{id}/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieves a specific discussion using ID.

HTTP Request

GET /api/v2/discussion/{id}/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this discussion.

Example responses

200 Response

{
  "id": 0,
  "categories": [
      {
      "id": 0,
      "tags": [],
      "order": 123,
      "name": "string",
      "name_synonyms": "string",
      "slug": "string",
      "slogan": "string",
      "html_info": "string",
      "seo_title": "string",
      "seo_description": "string",
      "auto_follow": "string",
      "active": true,
      "deleted": false,
      "image_original": "string",
      "image_bigger": "string",
      "image_big": "string",
      "image_medium": "string",
      "image_small": "string",
      "emotional_image_original": "string",
      "emotional_image_position": 123,
      "lastmod_datetime": "2019-08-24T14:15:22Z",
      "stream_order_by": "string",
    }
  ],
  "medias": [
    {
      "id": 0,
      "added_at": "2019-08-24T14:15:22Z",
      "type": "url",
      "title": "string",
      "description": "string",
      "url": "https://example.com",
      "image": "string",
      "image_width": 0,
      "image_height": 0,
      "order": 0,
      "embed": {
        "id": 0,
        "embed_type": "string",
        "embed_id": "string",
        "url": "string",
        "metadata": {}
      }
    }
  ],
  "location": {
    "location": "string",
    "lat": 0,
    "lng": 0
  },
  "poll": {
    "id": 0,
    "title": "string",
    "multiple_choices": true,
    "added_at": "2019-08-24T14:15:22Z",
    "modified_at": "2019-08-24T14:15:22Z",
    "closed": true,
    "expiration_at": "2019-08-24T14:15:22Z",
    "hidden": "string",
    "choices": [
      {
        "id": 0,
        "choice": "string",
        "order": 0,
        "added_at": "2019-08-24T14:15:22Z",
        "deleted": "string",
        "vote_count": 0,
        "voted": true
      }
    ]
  },
  "last_activity_at": "2019-08-24T14:15:22Z",
  "author": {
    "id": 0,
    "username": "string",
    "real_name": "string",
    "date_joined": "2019-08-24T14:15:22Z",
    "bio": "string",
    "location": "string",
    "location_lat_lng": "string",
    "position_lat_lng": "string",
    "date_of_birth": "string",
    "description": "string",
    "gender": "Male",
    "website": "https://example.com",
    "avatar": "string",
    "cover": "string",
    "ext_id": "string",
    "tags": [],
    "reputation": 111,
    "followings_counter": 1,
    "followers_counter": 1,
    "posts_counter": 2,
    "discussions_counter": 4,
    "statuses_counter": 1,
    "polls_counter": 6
  },
  "added_at": "2019-08-24T14:15:22Z",
  "html": "string",
  "summary": "string",
  "deleted": true,
  "collapsed": false,
  "comment_count": 0,
  "vote_count": "string",
  "voted": false,
  "flag_count": 0,
  "share_count": 0,
  "addressing": [],
  "title": "string",
  "slug": "string",
  "view_count": 1,
  "follower_count": "string"
}

Responses

Status Meaning Description Schema
200 OK none Discussion

Update a specific Discussion

Code samples

# You can also use wget
curl -X PUT /api/v2/discussion/{id}/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}' \
  --data-raw '{
    "title": "string",
    "text": "string",
    "categories": [0],
    "medias": [0],
    "location": {
      "location": "string",
      "lat": 0,
      "lng": 0
    },
    "poll": {
      "title": "string",
      "multiple_choices": true,
      "closed": true,
      "expiration_at": "2019-08-24T14:15:22Z",
      "choices": [
        {
          "choice": "string"
        }
      ]
    },
    "addressing": []
  }'
const inputBody = {
  "title": "string",
  "text": "string",
  "categories": [0],
  "medias": [0],
  "location": {
    "location": "string",
    "lat": 0,
    "lng": 0
  },
  "poll": {
    "title": "string",
    "multiple_choices": true,
    "closed": true,
    "expiration_at": "2019-08-24T14:15:22Z",
    "choices": [
      {
        "choice": "string"
      }
    ]
  },
  "addressing": []
};
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/discussion/{id}/',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint update a specific discussion.

HTTP Request

PUT /api/v2/discussion/{id}/

Body parameter

{
  "title": "string",
  "text": "string",
  "categories": [0],
  "medias": [0],
  "location": {
    "location": "string",
    "lat": 0,
    "lng": 0
  },
  "poll": {
    "title": "string",
    "multiple_choices": true,
    "closed": true,
    "expiration_at": "2019-08-24T14:15:22Z",
    "choices": [
      {
        "choice": "string"
      }
    ]
  },
  "addressing": []
}

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this discussion
» title body string¦null true The title of the discussion
» text body string false The content of the discussion in html format, it can contain some mentions
» categories body list(integer) true List of id of Category
» medias body list(integer) false List of id of Media
» location body object¦null false The Location object to associate at the discussion
»» location body string¦null true none
»» lat body number¦null true none
»» lng body number¦null true none
» poll body object¦null false The poll object to associate at the discussion
»» title body string true none
»» multiple_choices body boolean false none
»» expiration_at body string(date-time) false none
»» choices body list(object) true none
»»» choice body string true none
» addressing body list(integer) false List of id of Tag

Example responses

200 Response

{
  "id": 0,
  "categories": [
    {
      "id": 0,
      "tags": [],
      "order": 123,
      "name": "string",
      "name_synonyms": "string",
      "slug": "string",
      "slogan": "string",
      "html_info": "string",
      "seo_title": "string",
      "seo_description": "string",
      "auto_follow": "string",
      "active": true,
      "deleted": false,
      "image_original": "string",
      "image_bigger": "string",
      "image_big": "string",
      "image_medium": "string",
      "image_small": "string",
      "emotional_image_original": "string",
      "emotional_image_position": 123,
      "lastmod_datetime": "2019-08-24T14:15:22Z",
      "stream_order_by": "string",
    }
  ],
  "medias": [
    {
      "id": 0,
      "added_at": "2019-08-24T14:15:22Z",
      "type": "url",
      "title": "string",
      "description": "string",
      "url": "https://example.com",
      "image": "string",
      "image_width": 0,
      "image_height": 0,
      "order": 0,
      "embed": {
        "id": 0,
        "embed_type": "string",
        "embed_id": "string",
        "url": "string",
        "metadata": {}
      }
    }
  ],
  "location": {
    "location": "string",
    "lat": 0,
    "lng": 0
  },
  "poll": {
    "id": 0,
    "title": "string",
    "multiple_choices": true,
    "added_at": "2019-08-24T14:15:22Z",
    "modified_at": "2019-08-24T14:15:22Z",
    "closed": true,
    "expiration_at": "2019-08-24T14:15:22Z",
    "hidden": "string",
    "choices": [
      {
        "id": 0,
        "choice": "string",
        "order": 0,
        "added_at": "2019-08-24T14:15:22Z",
        "deleted": "string",
        "vote_count": 0,
        "voted": true
      }
    ]
  },
  "last_activity_at": "2019-08-24T14:15:22Z",
  "author": {
    "id": 0,
    "username": "string",
    "real_name": "string",
    "date_joined": "2019-08-24T14:15:22Z",
    "bio": "string",
    "location": "string",
    "location_lat_lng": "string",
    "position_lat_lng": "string",
    "date_of_birth": "string",
    "description": "string",
    "gender": "Male",
    "website": "https://example.com",
    "avatar": "string",
    "cover": "string",
    "ext_id": "string",
    "tags": [],
    "reputation": 111,
    "followings_counter": 1,
    "followers_counter": 1,
    "posts_counter": 2,
    "discussions_counter": 4,
    "statuses_counter": 1,
    "polls_counter": 6
  },
  "added_at": "2019-08-24T14:15:22Z",
  "html": "string",
  "summary": "string",
  "deleted": true,
  "collapsed": false,
  "comment_count": 0,
  "vote_count": "string",
  "voted": false,
  "flag_count": 0,
  "share_count": 0,
  "addressing": [],
  "title": "string",
  "slug": "string",
  "view_count": 1,
  "follower_count": "string"
}

Responses

Status Meaning Description Schema
200 OK none UpdateDiscussion

Delete a Discussion

Code samples

# You can also use wget
curl -X DELETE /api/v2/discussion/{id}/
  -H 'Authorization: Bearer {access_token}'


fetch('/api/v2/discussion/{id}/',
{
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer {access_token}'
  }

})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint delete a Discussion.

HTTP Request

DELETE /api/v2/discussion/{id}/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this discussion.

Responses

Status Meaning Description Schema
204 No Content none None

Restore a Discussion

Code samples

# You can also use wget
curl -X POST /api/v2/discussion/{id}/restore/
  -H 'Authorization: Bearer {access_token}'


fetch('/api/v2/discussion/{id}/restore/',
{
  method: 'POST',
  headers: {
    'Authorization': 'Bearer {access_token}'
  }

})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint restore a Discussion.

HTTP Request

DELETE /api/v2/discussion/{id}/restore/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this discussion.

Responses

Status Meaning Description Schema
204 No Content none None

Code samples

# You can also use wget
curl -X GET /api/v2/discussion/{id}/related/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}'

const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/discussion/{id}/related/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieve related discussions

HTTP Request

GET /api/v2/discussion/{id}/related/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this discussion.
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.

Example responses

200 Response

{
  "count": 123,
  "next": "string",
  "previous": "string",
  "results": [
      {
        "id": 0,
        "categories": [
            {
              "id": 0,
              "tags": [],
              "order": 123,
              "name": "string",
              "name_synonyms": "string",
              "slug": "string",
              "slogan": "string",
              "html_info": "string",
              "seo_title": "string",
              "seo_description": "string",
              "auto_follow": "string",
              "active": true,
              "deleted": false,
              "image_original": "string",
              "image_bigger": "string",
              "image_big": "string",
              "image_medium": "string",
              "image_small": "string",
              "emotional_image_original": "string",
              "emotional_image_position": 123,
              "lastmod_datetime": "2019-08-24T14:15:22Z",
              "stream_order_by": "string",
          }
        ],
        "medias": [
          {
            "id": 0,
            "added_at": "2019-08-24T14:15:22Z",
            "type": "url",
            "title": "string",
            "description": "string",
            "url": "https://example.com",
            "image": "string",
            "image_width": 0,
            "image_height": 0,
            "order": 0,
            "embed": {
              "id": 0,
              "embed_type": "string",
              "embed_id": "string",
              "url": "string",
              "metadata": {}
            }
          }
        ],
        "location": {
            "location": "string",
            "lat": 0,
            "lng": 0
        },
        "poll": {
          "id": 0,
          "title": "string",
          "multiple_choices": true,
          "added_at": "2019-08-24T14:15:22Z",
          "modified_at": "2019-08-24T14:15:22Z",
          "closed": true,
          "expiration_at": "2019-08-24T14:15:22Z",
          "hidden": "string",
          "choices": [
            {
                "id": 0,
                "choice": "string",
                "order": 0,
                "added_at": "2019-08-24T14:15:22Z",
                "deleted": "string",
                "vote_count": 0,
                "voted": true
            }
          ]
        },
        "last_activity_at": "2019-08-24T14:15:22Z",
        "author": {
            "id": 0,
            "username": "string",
            "real_name": "string",
            "date_joined": "2019-08-24T14:15:22Z",
            "bio": "string",
            "location": "string",
            "location_lat_lng": "string",
            "position_lat_lng": "string",
            "date_of_birth": "string",
            "description": "string",
            "gender": "Male",
            "website": "https://example.com",
            "avatar": "string",
            "cover": "string",
            "ext_id": "string",
            "tags": [],
            "reputation": 111,
            "followings_counter": 1,
            "followers_counter": 1,
            "posts_counter": 2,
            "discussions_counter": 4,
            "statuses_counter": 1,
            "polls_counter": 6
        },
        "added_at": "2019-08-24T14:15:22Z",
        "html": "string",
        "summary": "string",
        "deleted": true,
        "collapsed": false,
        "comment_count": 0,
        "vote_count": "string",
        "voted": false,
        "flag_count": 0,
        "share_count": 0,
        "addressing": [],
        "title": "string",
        "slug": "string",
        "view_count": 1,
        "follower_count": "string"
      }
    ]
}

Responses

Status Code 200

Name Type Required Restrictions Description
» count integer true none Total results count
» next string¦null false none Next page url
» previous string¦null false none Previous page url
» results list(Discussion) true none List of results

Get List of Votes for a Specific Discussion

Code samples

# You can also use wget
curl -X GET /api/v2/discussion/{id}/vote/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}'

const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/discussion/{id}/vote/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieves all votes for a specific discussion.

HTTP Request

GET /api/v2/discussion/{id}/vote/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this discussion.
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.

Example responses

200 Response

{
  "count": 123,
  "next": "string",
  "previous": "string",
  "results": [
      {
        "user": {
          "id": 0,
          "username": "string",
          "real_name": "string",
          "email": "user@example.com",
          "email_isvalid": true,
          "date_joined": "2019-08-24T14:15:22Z",
          "bio": "string",
          "location": "string",
          "location_lat_lng": "string",
          "position_lat_lng": "string",
          "date_of_birth": "2019-08-24",
          "description": "string",
          "gender": "Male",
          "status": "a",
          "website": "https://example.com",
          "avatar": "string",
          "cover": "string",
          "ext_id": "string",
          "tags": [
            {
              "id": 0,
              "active": true,
              "type": "user",
              "name": "string",
              "description": "string",
              "color": "string",
              "visible": true,
              "deleted": true,
              "created_at": "2019-08-24T14:15:22Z"
            }
          ],
          "reputation":111,
          "followings_counter": 1,
          "followers_counter": 1,
          "posts_counter": 2,
          "discussions_counter": 5,
          "statuses_counter": 1,
          "polls_counter": 7
        },
        "voted_at": "2019-08-24T14:15:22Z"
      }
  ]
}

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer true none Total results count
» next string¦null false none Next page url
» previous string¦null false none Previous page url
» results list(Vote) true none List of results

Upvote for a Specific Discussion

Code samples

# You can also use wget
curl -X POST /api/v2/discussion/{id}/vote/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}'

const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/discussion/{id}/vote/',
{
  method: 'POST',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint upvotes a specific discussion.

HTTP Request

POST /api/v2/discussion/{id}/vote/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this discussion.

Responses

Status Meaning Description Schema
204 No Content none None

Remove an Upvote for a Specific Discussion

Code samples

# You can also use wget
curl -X POST /api/v2/discussion/{id}/vote/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}'

const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/discussion/{id}/vote/',
{
  method: 'POST',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint removes an upvote for a specific discussion.

HTTP Request

POST /api/v2/discussion/{id}/vote/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this discussion.

Responses

Status Meaning Description Schema
204 No Content none None

Get List of Poll Votes for a Specific Discussion

Code samples

# You can also use wget
curl -X GET /api/v2/discussion/{id}/poll/vote/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}'

const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/discussion/{id}/poll/vote/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieves all poll votes for a specific discussion. The choice parameter is used to filter the votes by a given poll choice of the poll. If the discussion has no poll associated the response status code is 404.

HTTP Request

GET /api/v2/discussion/{id}/poll/vote/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this discussion.
limit query integer false Number of results to return per page.
offset query integer false The initial index from which to return the results.
choice query integer false The choice id of the poll. If is specified the endpoint retrieves the votes of only that choice

Example responses

200 Response

{
  "count": 123,
  "next": "string",
  "previous": "string",
  "results": [
      {
        "id": 0,
        "choice": "string",
        "user": {
          "id": 0,
          "username": "string",
          "real_name": "string",
          "email": "user@example.com",
          "email_isvalid": true,
          "date_joined": "2019-08-24T14:15:22Z",
          "bio": "string",
          "location": "string",
          "location_lat_lng": "string",
          "position_lat_lng": "string",
          "date_of_birth": "2019-08-24",
          "description": "string",
          "gender": "Male",
          "status": "a",
          "website": "https://example.com",
          "avatar": "string",
          "cover": "string",
          "ext_id": "string",
          "tags": [
            {
              "id": 0,
              "active": true,
              "type": "user",
              "name": "string",
              "description": "string",
              "color": "string",
              "visible": true,
              "deleted": true,
              "created_at": "2019-08-24T14:15:22Z"
            }
          ],
          "reputation":111,
          "followings_counter": 1,
          "followers_counter": 1,
          "posts_counter": 2,
          "discussions_counter": 5,
          "statuses_counter": 1,
          "polls_counter": 7
        }
      }
  ]
}

Response Schema

Status Code 200

Name Type Required Restrictions Description
» count integer true none Total results count
» next string¦null false none Next page url
» previous string¦null false none Previous page url
» results list(PollVote) true none List of results

Upvote for a Specific Poll Choice

Code samples

# You can also use wget
curl -X POST /api/v2/discussion/{id}/poll/vote/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}'
  --data-raw '{
    "choice": 0
  }'
const inputBody = {
  "choice": 0
};
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/discussion/{id}/poll/vote/',
{
  method: 'POST',
  headers: headers,
  body: inputBody
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint upvotes a specific poll choice in a discussion. If the discussion has no poll associated the response status code is 404.

HTTP Request

POST /api/v2/discussion/{id}/poll/vote/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this discussion.
choice body integer true A unique integer value identifying the choice to be upvoted.

Responses

Status Meaning Description Schema
204 No Content none None

Remove an Upvote for a Specific Poll Choice

Code samples

# You can also use wget
curl -X POST /api/v2/discussion/{id}/poll/vote/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}'
  --data-raw '{
    "choice": 0
  }'
const inputBody = {
  "choice": 0
};
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/discussion/{id}/poll/vote/',
{
  method: 'POST',
  headers: headers,
  body: inputBody
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint remove an upvote from a specific poll choice in a discussion. If the discussion has no poll associated the response status code is 404.

HTTP Request

POST /api/v2/discussion/{id}/poll/vote/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this discussion.
choice body integer true A unique integer value identifying the choice to be upvoted.

Responses

Status Meaning Description Schema
204 No Content none None

Follow a Discussion

Code samples

# You can also use wget
curl -X POST /api/v2/discussion/{id}/follow/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}'
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/discussion/{id}/follow/',
{
  method: 'POST',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint follows a discussion.

HTTP Request

POST /api/v2/discussion/{id}/follow/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this discussion.

Responses

Status Meaning Description Schema
204 No Content none None

Unfollow a Discussion

Code samples

# You can also use wget
curl -X POST /api/v2/discussion/{id}/follow/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}'
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/discussion/{id}/follow/',
{
  method: 'POST',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint unfollows a discussion.

HTTP Request

POST /api/v2/discussion/{id}/follow/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this discussion.

Responses

Status Meaning Description Schema
204 No Content none None

Get List of Flags for a Specific Discussion

Code samples

# You can also use wget
curl -X GET /api/v2/discussion/{id}/flag/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}'
const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/discussion/{id}/flag/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint retrieves a List of Flags for a Specific Discussion.

HTTP Request

GET /api/v2/discussion/{id}/flag/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this discussion.

Example responses

200 Response

{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
          "user": {
            "id": 0,
            "username": "string",
            "real_name": "string",
            "date_joined": "2019-08-24T14:15:22Z",
            "bio": "string",
            "location": "string",
            "location_lat_lng": "string",
            "position_lat_lng": "string",
            "date_of_birth": "2019-08-24",
            "description": "string",
            "gender": "Male",
            "website": "https://example.com",
            "avatar": "string",
            "cover": "string",
            "ext_id": "string",
            "tags": [
              {
                "id": 0,
                "active": true,
                "type": "user",
                "name": "string",
                "description": "string",
                "color": "string",
                "visible": true,
                "deleted": true,
                "created_at": "2019-08-24T14:15:22Z"
              }
            ],
            "reputation": 111,
            "followings_counter": 1,
            "followers_counter": 1,
            "posts_counter": 2,
            "discussions_counter": 5,
            "statuses_counter": 1,
            "polls_counter": 7
          },
          "added_at": "2019-08-24T14:15:22Z",
          "flag_type": 0,
          "flag_type_description": "string"
        }
    ]
}

Responses

Status Meaning Description Schema
200 OK none Flag

Flag a Specific Discussion

Code samples

# You can also use wget
curl -X POST /api/v2/discussion/{id}/flag/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}'
const inputBody = {
  "flag_type": 0
};
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/discussion/{id}/flag/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint flag a specific discussion.

HTTP Request

POST /api/v2/discussion/{id}/flag/

Body parameter

{
  "flag_type": 0
}

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this post.
flag_type body integer true A integer from 0 to 4

Enumerated Values

Parameter Value Description
flag_type 0 spam
flag_type 1 aggressive
flag_type 2 vulgar
flag_type 3 poor
flag_type 4 offtopic

Responses

Status Meaning Description Schema
204 No Content none None

Unflag a Specific Discussion

Code samples

# You can also use wget
curl -X POST /api/v2/discussion/{id}/flag/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}'
const inputBody = {
  "flag_type": 0
};
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/discussion/{id}/flag/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This endpoint removes a flag for a specific discussion.

HTTP Request

POST /api/v2/discussion/{id}/flag/

Body parameter

{
  "flag_type": 0
}

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this post.
flag_type body integer true A integer from 0 to 4

Enumerated Values

Parameter Value Description
flag_type 0 spam
flag_type 1 aggressive
flag_type 2 vulgar
flag_type 3 poor
flag_type 4 offtopic

Responses

Status Meaning Description Schema
204 No Content none None

Get Flag Status for a Specific Discussion

Code samples

# You can also use wget
curl -X GET /api/v2/discussion/{id}/flag/status/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}' \


const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/discussion/{id}/flag/status/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

Retrieve if exists a flag for this contribute created by the user logged

HTTP Request

GET /api/v2/discussion/{id}/flag/status/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this discussion.

Example responses

200 Response

{
  "added_at": "2019-08-24T14:15:22Z",
  "flag_type": 0,
  "flag_type_description": "string"
}

Responses

Status Meaning Description Schema
200 OK none Flag

Hide a Specific Discussion

Code samples

# You can also use wget
curl -X POST /api/v2/discussion/{id}/hide/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}' \


const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/discussion/{id}/hide/',
{
  method: 'POST',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This Endpoint hide the Discussion for the logged user. The discussion must be in show state.

HTTP Request

POST /api/v2/discussion/{id}/hide/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this discussion.

Responses

Status Meaning Description Schema
204 No Content none None

Show a Specific Discussion

Code samples

# You can also use wget
curl -X POST/api/v2/discussion/{id}/hide/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access_token}' \


const headers = {
  'Accept':'application/json',
  'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/discussion/{id}/hide/',
{
  method: 'POST',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

This Endpoint show the Discussion for the logged user. The discussion must be in hidden state.

HTTP Request

POST /api/v2/discussion/{id}/hide/

Parameters

Name In Type Required Description
id path string true A unique integer value identifying this discussion.

Responses

Status Meaning Description