Content Management System (CMS)

Auxiliary Login API Overview

The Auxiliary Login API allows merchants to authenticate users and generate JSON Web Tokens (JWT) for user sessions. This API is designed to be integrated into merchant applications for user authentication purposes.

Base URL

POST /api/v1/apps/authenitcate

Request

  • Method: POST

  • Headers:

    • Content-Type: application/json

  • Body:

    Key
    Key data type
    Required
    Description

    merchant

    string

    true

    Marketplate Merchant Identifier

    user

    string

    true

    Spoonity User Identifier

    vendor

    string

    true

    Spoonity vendor Identifier

Response

  • Status Codes:

    • 201 Created: Successful login, returns a JWT token.

    • 422 Unprocessable Entity: User does not exist.

  • Body (on success):

{
  "token": "string",
  "isAdmin": "boolean"
}
  • token: JSON Web Token (JWT) for user session.

  • isAdmin: Boolean indicating whether the user is an admin.

Error Responses

  • 422 Unprocessable Entity

    • Body:

{
  "message": "User Does Not Exist"
}
  • Other possible errors:

    • Internal server error (500): In case of unexpected errors during token generation.

Notes

  • The generated token should be included in subsequent requests to authenticate the user.

  • The isAdmin field indicates whether the user has administrative privileges.

  • Make sure to handle errors gracefully, especially in the case of user not found.

CMS Content API Overview

The CMS Content API allows fetching content from a Content Management System (CMS) based on the provided token and API group. This API is designed to retrieve various types of content for integration into merchant applications.

Base URL

GET /api/v1/apps/home

Request

  • Method: GET

  • Headers:

    • Content-Type: application/json

    • Authorization: Bearer <token>

      • The token should be provided in the request header for authentication.

  • Query Parameters:

    Key
    Key data type
    Required
    Description

    page

    number

    false

    Page number for pagination (Default is 1)

    group

    string

    true

    Group identifier for the card. (Required can have up to 6 comma separated groups)

    timeFilter

    string

    false

    Filter Content by Active or Inactive (Future Event)

Response

  • Status Codes:

    • 200 OK: Successful retrieval of content.

    • 500 Internal Server Error: An unexpected error occurred.

  • Body:

{
  "id": "number",
  "content_group": "string",
  "group_id": "number",
  "primary_content": "string",
  "secondary_content": "string",
  "description": "string",
  "image": "string",
  "action_title": "string",
  "navigation_url": "string",
  "expiry": "string",
  "navigation": "number",
  "screen": "string",
  "testMode": "boolean",
  "link": "string",
  "navigation_link": "string",
  "qr_url": "string",
  "available_days": "array",
  "available_days_month": "array",
  "menu_product": [
          {
              "name": "string",
              "image": "string"
          }
      ],
      "available_time": {
          "start": "number",
          "end": "number"
      },
      "home_id": "number",
      "created": "string"
}
  • id: Not Used.

  • home_id: CMS Content ID

  • content_group: Content group name

  • group_id: Content Sub Group ID.

  • primary_content: CMS primary content

  • secondary_content: CMS secondary content

  • description: CMS description content

  • image: CMS content image

  • action_title: CMS content button title

  • navigation: Internal App navigation screen name on content click

  • navigation_url: external URL to redirect on content click

  • expiry: CMS expiry in UTC

  • qr_url: Content QR URL entry

  • available_days: days when the CMS content is active 0 - Sunday to 6 - Saturday.

  • available_days_month: calendar days when the CMS content is active 1 to 31.

  • menu_product: list of menu item that is linked to CMS with images.

    • name: Name of the lime item

    • image: Image Url for line item

  • available_time: time when the cms content is active

  • created: CMS created time in UTC

Error Responses

  • 500 Internal Server Error

    • Body:

{
  "message": "Internal Server Error"
}

Notes

  • The token provided in the Authorization header is used for authentication and authorization.

  • Depending on the type parameter, additional parameters such as page and group may be required.

  • Handle errors gracefully and provide appropriate error messages for better debugging and user experience.

Last updated

Was this helpful?