Skip to main content

Getting Started with Emerit Services API

Welcome to the Emerit API documentation. Our API allows third-party applications to connect with our GraphQL interface, providing comprehensive access to all Emerit services. Whether you're looking to integrate single features or leverage the full suite of services we offer, this guide will help you get started.

Understanding GraphQL​

GraphQL is a query language for APIs and a runtime for executing those queries by using a type system you define for your data. Unlike REST APIs, GraphQL APIs allow clients to request only the data they need, making it an efficient choice for web and mobile applications. Queries in GraphQL are sent as strings and can be made for specific data, which means less loading time and a more seamless integration into your application.

Setting Up Your Environment​

Before you can start using the Emerit API, you need to set up your development environment. This involves getting an API key for authentication and setting up your application to make requests to our GraphQL endpoint.

Getting Your API Key​

  1. Navigate to https://app.emerit-services.com.
  2. Log in to access to My Company page : app.emerit-services.com/my-company
  3. Navigate to the API keys section and display your API key.

Authenticating Your Requests​

All requests to the Emerit API must be authenticated using your API key. Include your API key in the header of your requests like so:

apiKey: YOUR_API_KEY

Making Your First GraphQL Query​

This query fetches the integrator's information, including users, end customers and their devices.

With an integrator API key, featureLicenses returns the signed firmware licences for each device in the response. Each assigned feature contains a device-specific licenseString and its Base64 signature. Unassigned features and features on other device models return null. A user session receives null for the entire featureLicenses field. The example uses synthetic device data and signatures generated with a test key.

The Advanced Location (advancedLocation) licence also enables the address option in internal-recipient SMS messages (Google Reverse Geocoding). Its signed firmware object is returned in advancedLocLicence.

query GET_MY_INTEGRATOR_INFOS {
getMyIntegratorInfos {
id
name
users {
id
email
}
endCustomers {
id
companyName
sites {
id
name
devices {
id
featureLicenses {
lwLicence {
licenseString
signature
}
advancedLocLicence {
licenseString
signature
}
WifiVoipLicence {
licenseString
signature
}
}
deviceModel {
uid
}
softwareVersion {
versionNumber
}
}
}
}
}
}

To execute this query, send a POST request to https://api.emerit-services.com/graphql with the query in the body, and don't forget to include your ApiKey header.

The response will contain the data you requested in the query. You can then use this data for further processing in your application.

Here an example of a response:

{
"data": {
"getMyIntegratorInfos": {
"id": "110b7167-7f95-499b-b827-996add5297e0",
"name": "Integrator name",
"users": [
{
"id": "4f25e02e-ea24-4c73-97eb-576e9bc7eaaf",
"email": "test@test.fr"
},
{
"id": "c0d6d6aa-c8e7-4fac-b04b-0f69c5a14344",
"email": "admin@company.com"
}
],
"endCustomers": [
{
"id": "250b7167-7f95-499b-b827-996add5297e0",
"companyName": "Apollo Inc.",
"sites": [
{
"id": "210b7167-7f95-499b-b827-996add5297e0",
"name": "Site de Paris",
"devices": [
{
"id": "514a9257-3195-4799-a5ef-23a79983935a",
"featureLicenses": {
"lwLicence": {
"licenseString": "emerit-config.feature.e-sd1.lone-worker|352681730001295|1793268000|4102444799",
"signature": "/8CNmWvbKzHDsNhVolO0xoXh2ou5jDPT9uJSt1HkEetUgR8nsAhntWO4K0VVBwHpV63fgcHVQQz2l1wHD8cM8Q=="
},
"advancedLocLicence": {
"licenseString": "emerit-config.feature.e-sd1.advanced-location|352681730001295|1793268000|4102444799|BP2lPEJFTgd2y4Gj9q/OOGh5wdSHgMpNd7na+Ek/qkI6zLGUEr0FNGHVeaW3SjG8DNVw",
"signature": "WJjBYjm8g+aZVDZxVlCZnRN89v51Ff28T6LyBVGab/RtBKYEqfE9sZG+sV8FLsAlk0YdPLfInXw2xvI3zFDVfg=="
},
"WifiVoipLicence": {
"licenseString": "emerit-config.feature.e-sd1.wifi-voip|352681730001295|1793268000|4102444799",
"signature": "s7bDmmMlH5EzSs8oBb4zYVNmYTFVR6a3VqOExrTbZg6CgPx7J7fkbLpSMq2IBHIWiB8fxmaKUh1bVeipTUOFBw=="
}
},
"deviceModel": {
"uid": "E-SD1"
},
"softwareVersion": {
"versionNumber": "1.0.0"
}
},
{
"id": "a3a9a340-bdba-47cf-86a9-b1efd7bc38b1",
"featureLicenses": {
"lwLicence": null,
"advancedLocLicence": null,
"WifiVoipLicence": null
},
"deviceModel": {
"uid": "E-RG655"
},
"softwareVersion": {
"versionNumber": "1.0.0"
}
}
]
}
]
}
]
}
}
}

Fetching Device Information by Unique ID​

You can also retrieve specific device details using its unique identifier (Serial Number or IMEI). This is useful when you have the physical device or its label info and need to fetch its configuration or status.

query GET_DEVICE_BY_UNIQUE_ID {
findDeviceByUniqueIdNumber(uniqueIdNumber: "YOUR_DEVICE_UNIQUE_ID") {
id
uniqueIdNumber
deviceModel {
uid
}
site {
id
name
}
softwareVersion {
versionNumber
}
}
}