Members API

Restrict access to parts of your product with users management.


Login

Login your users with their username and password and get their profile information.

REQUEST POST /members/login/
{
  "authentication": {
    "partnerId": "your-partner-id",
    "signature": "your-signature",
    "ip":"123.456.78.912"
  },
  "login":{
      "username":"string",
      "password":"string"
  }
}
RESPONSE SUCCESS
{
  "status": "connected",
  "username": "john.doe",
  "sessionId": "MjAyMS0wNC0yNyAyMzoxMjoyMDQ0NzU3Nw==",
  "profile": {
      "firstName": "John",
      "lastName": "Doe",
      "photo": "https://www.fridayfactory.dev/john.jpg"
  },
  "locale": {
      "language": "en",
      "timezone": "Asia/Singapore"
  },
  "contact": {
      "phone": "+650000000",
      "email": "john.doe@gmail.com",
      "address": "160 robinson road",
      "city": "Singapore",
      "postcode": "123456",
      "country": "Singapore"
  }
}
RESPONSE ERROR
{
    "status": "missing_account",
    "message": "Account not found."
}

Session

Check if the user's session is still active or if he should be disconnected using the same sessionId as in the login call response.

REQUEST POST /members/session/
{
"authentication": {
  "partnerId": "your-partner-id",
  "signature": "your-signature",
  "ip":"123.456.78.912"
},
  "sessionId":"MjAyMS0wNC0yNyAyMzoxMjoyMDQ0NzU3Nw=="
}
RESPONSE SUCCESS
{
    "status": "connected",
    "message": "Session is active."
}
RESPONSE ERROR
{
    "status": "disconnected",
    "message": "No active session with that ID."
}

Update profile

Use this call to update the profile details of the user. The photo value is using the standard base64 image format turning the image into encoded characters. All images will be stored in our CDN for faster global access.

REQUEST POST /members/update/
{
  "authentication": {
    "partnerId": "your-partner-id",
    "signature": "your-signature",
    "ip":"123.456.78.912"
  },
  "profile":{
    "username":"john.doe",
    "firstName": "John",
    "lastName": "Doe",
    "photo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgA..",
    "language": "en",
    "timezone": "Asia/Singapore",
    "phone": "+650000000",
    "email": "john.doe@gmail.com",
    "address": "160 robinson road",
    "city": "Singapore",
    "postcode": "123456",
    "country": "Singapore"
  }
}
RESPONSE SUCCESS
{
  "status": "success",
  "message": "Profile was updated successfully."
}
RESPONSE ERROR
{
  "status": "error",
  "message": "User does not exist."
}

Logout

Logout your users using the same sessionId as in the login call response.

REQUEST POST /members/logout/
{
  "authentication": {
    "partnerId": "your-partner-id",
    "signature": "your-signature",
    "ip":"123.456.78.912"
  },
  "sessionId":"MjAyMS0wMy0xNyAyMDoxMDo0MzU2ODgxNA=="
}
RESPONSE SUCCESS
{
  "status": "disconnected",
  "message": "User logged-out."
}
RESPONSE ERROR
{
  "status": "error",
  "message": "Session ID can't be empty."
}