FMLDevelopers

Badges

Get a badge by id

GET/badge/{badgeid}Member token required

Requires a user token. Returns 404 if the badge doesn't exist.

Parameters

badgeidrequiredin the pathformat \d+
integer, required — badge id

Values

category : 1 => bronze | 2 => silver | 3 => gold
Request
curl "https://www.fmylife.com/api/v2/badge/{badgeid}" \
  -H "X-VDM-Api-Key: $API_KEY" \
  -H "X-VDM-Api-Token: $TOKEN"
Response 200
{
  "data": {
    "id": 1,
    "site": null,
    "name": "Beginner",
    "description": "You have looked through 5 pages of the website. That’s a start.",
    "hidden": "0",
    "goal": 5,
    "limited": "0",
    "category": 1,
    "total": 7698968,
    "illustration": "lI6nHr5hWXlu0.gif"
  },
  "meta": {},
  "badge": [],
  "badge_display": []
}

A real API response, on test data. Lists are cut to 2 items.

Possible errors

401

{
  "data": [
    "You must be authenticated in order to access this function."
  ],
  "meta": {},
  "badge": [],
  "badge_display": []
}

404

{
  "data": "Badge not found.",
  "meta": {},
  "badge": [],
  "badge_display": []
}

List badges

GET/badge/listMember token required

Requires a user token. Returns every badge except hidden ones.

Parameters

No parameters.

Values

category : 1 => bronze | 2 => silver | 3 => gold
Request
curl "https://www.fmylife.com/api/v2/badge/list" \
  -H "X-VDM-Api-Key: $API_KEY" \
  -H "X-VDM-Api-Token: $TOKEN"
Response 200
{
  "data": [
    {
      "id": 1,
      "site": null,
      "name": "Beginner",
      "description": "You have looked through 5 pages of the website. That’s a start.",
      "hidden": "0",
      "goal": 5,
      "limited": "0",
      "category": 1,
      "total": 7698968,
      "illustration": "lI6nHr5hWXlu0.gif"
    },
    {
      "id": 2,
      "site": null,
      "name": "Profile completed",
      "description": "You’ve filled out the necessary details. Having done so will be much appreciated.",
      "hidden": "0",
      "goal": 1,
      "limited": "0",
      "category": 1,
      "total": 192675,
      "illustration": "2.gif"
    }
  ],
  "meta": {},
  "badge": [],
  "badge_display": []
}

A real API response, on test data. Lists are cut to 2 items.

Possible errors

401

{
  "data": [
    "You must be authenticated in order to access this function."
  ],
  "meta": {},
  "badge": [],
  "badge_display": []
}