Layerise Organisation API

Organisation API enables developers to access organisation data and build amazing experiences fast and with scale. This guide will assist you to integrate Layerise Organisation API.

Using the the API’s is easy and made available programmatically via. GraphQL-compliant API.

What is GraphQl?

GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.

We recommend using GraphQL Playground hosted by us to model queries, refer Schema & testing locally.

Pre-Requisites & Authentication

Authentication to Layerise Organisation API is done by setting a HTTP header organisationSecret token. The token is available in Layerise Admin

Playground HTTP Header

When using the GraphQL Playground you have to declare your API Token in the HTTP Headers. If you do not add or miss spell your token you will not be able to query your data and a 401 error (Response not successful: Received status code 401) will be displayed.

{
  	"organisationSecret": "your-token-available-at-layerise-admin"
}

Reference cURL request

curl -X POST -H "Content-Type: application/json" -H "organisationSecret:
<your-token-available-at-layerise-admin>

Reference Javascript request

const response = await fetch("https://api.layerise.com", { method: "POST", headers: { "Content-Type": "application/json", Accept: "application/json", organisationSecret: "
<your-token-available-at-layerise-admin>

Query Endpoints

Layerise Organisation API exposes following query endpoints:

  • Products
  • Customer
  • ProductRegistration
  • Experiences
  • Languages
  • Highlights
  • TopicCategories
  • ReminderSchemas
  • Query example
    {
     customers (limit: 100, skip: 0) {
      id
      phone
      email
      firstName
      country {
        id
        code
        nameEN
        nameLOCALE
      }
      registeredProducts {
        id 
        serialNumber
        claimerId
      }
     }
    }

    Each of the above endpoint can use following clauses:

  • where
  • orderBy
  • limit
  • skip
  • Filter Data using `where` clause

    {
     products(where: { archive: true }) {
      id
      title
     }
    }
    Sort Data using `orderBy` clause
    {
     topics(orderBy: createdAt_ASC) {
      id
      title
     }
    }
    Pagination using `limit` and `skip`
    {
     highlights(limit: 10, skip: 20) {
      id
      title
     }
    }

    Have a question?

    Ervin
    Oscar
    Martina
    Emil
    +9

    Trusted by companies like

    RaleighJägermeisterDrinkmateWellis

    Copyright © 2022 Layerise ApS. Made with 🧁  in Denmark · LinkedIn