Badges API

The badge API supports the creation, deletion, and updating of badges that could be used to distinguish your content from other content on your site.

Creating badges

Creates a badge.

POST /api/1.3/badges

Parameters

Name

Type

Description

name

String

Name - Required

image_id

String

ID of the uploaded image - Required

tags

Array of strings

Tags - Optional

category

Integer

Category - Optional
Choices:
- 0: Normal (Default)
- 1: Sponsored

description

String

Description - Required for sponsored badges only

link

Object

Link - Required for sponsored badges only

Response

{
     "id": 50,
     "name": "My first badge",
     "image_id": 400,
     "image": "https://s3.amazonaws.com/dev-assets.rbl.ms/<id>/210x.jpg",
     "tags": ["foo", "bar"],
     "category": 0,
     "description": "",
     "link": "",
     "order": 0,
}

Editing badges

Edits a badge.

PUT /api/1.3/badges/<id>

Parameters

The same requirements apply here as for Creating badges, only that there are no required fields.

Response

The response structure here is the same as the response structure used for Creating badges.

Deleting badges

Deletes a badge.

DELETE /api/1.3/badges/<id>

Response

The response payload is an empty object.

{}

List badges

Fetches all badges’ information.

GET /api/1.3/badges

Parameters

No parameters are required as all the badges are returned.

Response

It returns a list of objects whose structure and contents are detailed here: Creating badges.

Get a single badge

Fetches a single badge by ID.

GET /api/1.3/badges/<id>

Response

The response structure here is the same as the response structure used for Creating badges.