Introduction

				
					Base URL: api.gsmcloud.com
				
			

This documentation aims to provide all the information you need to work with our API.

Authenticating requests :

To authenticate requests, include an Authorization header in the form “Basic {credentials}”. The value of {credentials} should be your username/id and your password, joined with a colon (:), and then base64-encoded.

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

Devices

List all devices

Requires Authentication

GET

/devices

Headers

				
					Authorization:     
Example: Basic {YOUR_AUTH_KEY}

Content-Type:     
Example: application/json

Accept: 
Example: application/json
				
			
				
					Authorization:     
Example: Basic {YOUR_AUTH_KEY}

Content-Type:     
Example: application/json

Accept: 
Example: application/json
				
			
Response
				
					id: (integer)   
Device ID.

name: (string)   
Given name for the device.

imei: (string)   
IMEI number of the device.

last_package_at: (string)   
Last time the device was registered as online.

ports: (object)   
List of ports for the device.
				
			
Update a device

Requires Authentication

PATCH

/devices/{device_id}

Headers

				
					Authorization      
Example: Basic {YOUR_AUTH_KEY}

Content-Type      
Example: application/json

Accept      
Example: application/json
				
			

Url Parameters

				
					Device_id (Interger):
Example: 7
				
			

Body Parameters:

				
					Name (Name):
Example: libero
				
			
Example request:
				
					curl --request GET \
    --get "api.gsmcloud.dk/devices" \
    --header "Authorization: Basic {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
				
			
Example Response:
				
					[
    {
        "id": 1,
        "name": "Log test",
        "imei": "868333033900099",
        "last_package_at": "2023-07-10T22:44:04.000000Z",
        "ports": {
            "Power": {
                "name": "Power",
                "label": null,
                "direction": "input",
                "value": true,
                "type": "boolean"
            },
            "IN 1": {
                "name": "IN 1",
                "label": null,
                "direction": "input",
                "value": 300,
                "type": "temperature"
            },
            "IN 2": {
                "name": "IN 2",
                "label": null,
                "direction": "input",
                "value": 160,
                "type": "analog"
            },
            "IN 3": {
                "name": "IN 3",
                "label": null,
                "direction": "input",
                "value": true,
                "type": "boolean"
            },
            "Signal": {
                "name": "Signal",
                "label": null,
                "direction": "input",
                "value": 15,
                "type": "integer"
            },
            "Relay": {
                "name": "Relay",
                "label": null,
                "direction": "output",
                "value": null,
                "type": "boolean"
            },
            "Interval": {
                "name": "Interval",
                "label": null,
                "direction": "output",
                "value": null,
                "type": "integer"
            },
            "status": {
                "name": "status",
                "label": null,
                "direction": "input",
                "value": true,
                "type": "boolean"
            }
        }
    }
]
				
			
Example request:
				
					url --request PATCH \
    "api.gsmcloud.dk/devices/7" \
    --header "Authorization: Basic {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"libero\"
}"
				
			
Example response:
				
					(200, Device updated successfully):
				
			
Example responses With Error:
				
					(401, Not authorized):
				
			
				
					(422, Validation error):
				
			
Introduction
				
					Base URL: api.gsmcloud.com
				
			

This documentation aims to provide all the information you need to work with our API.

Authenticating requests :

To authenticate requests, include an Authorization header in the form “Basic {credentials}”. The value of {credentials} should be your username/id and your password, joined with a colon (:), and then base64-encoded.

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

Devices
List all devices

Requires Authentication

GET

/devices

Example request:
				
					curl --request GET \
    --get "api.gsmcloud.dk/devices" \
    --header "Authorization: Basic {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
				
			
Example Response:
				
					[
    {
        "id": 1,
        "name": "Log test",
        "imei": "868333033900099",
        "last_package_at": "2023-07-10T22:44:04.000000Z",
        "ports": {
            "Power": {
                "name": "Power",
                "label": null,
                "direction": "input",
                "value": true,
                "type": "boolean"
            },
            "IN 1": {
                "name": "IN 1",
                "label": null,
                "direction": "input",
                "value": 300,
                "type": "temperature"
            },
            "IN 2": {
                "name": "IN 2",
                "label": null,
                "direction": "input",
                "value": 160,
                "type": "analog"
            },
            "IN 3": {
                "name": "IN 3",
                "label": null,
                "direction": "input",
                "value": true,
                "type": "boolean"
            },
            "Signal": {
                "name": "Signal",
                "label": null,
                "direction": "input",
                "value": 15,
                "type": "integer"
            },
            "Relay": {
                "name": "Relay",
                "label": null,
                "direction": "output",
                "value": null,
                "type": "boolean"
            },
            "Interval": {
                "name": "Interval",
                "label": null,
                "direction": "output",
                "value": null,
                "type": "integer"
            },
            "status": {
                "name": "status",
                "label": null,
                "direction": "input",
                "value": true,
                "type": "boolean"
            }
        }
    }
]
				
			

Headers

				
					Authorization:     
Example: Basic {YOUR_AUTH_KEY}

Content-Type:     
Example: application/json

Accept: 
Example: application/json
				
			
				
					Authorization:     
Example: Basic {YOUR_AUTH_KEY}

Content-Type:     
Example: application/json

Accept: 
Example: application/json
				
			
Response
				
					id: (integer)   
Device ID.

name: (string)   
Given name for the device.

imei: (string)   
IMEI number of the device.

last_package_at: (string)   
Last time the device was registered as online.

ports: (object)   
List of ports for the device.
				
			
Update a device

Requires Authentication

PATCH

/devices/{device_id}

Example request:
				
					url --request PATCH \
    "api.gsmcloud.dk/devices/7" \
    --header "Authorization: Basic {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"libero\"
}"
				
			
Example response:
				
					(200, Device updated successfully):
				
			
Example responses With Error:
				
					(401, Not authorized):
				
			
				
					(422, Validation error):
				
			

Headers

				
					Authorization      
Example: Basic {YOUR_AUTH_KEY}

Content-Type      
Example: application/json

Accept      
Example: application/json
				
			

Url Parameters

				
					Device_id (Interger):
Example: 7
				
			

Body Parameters:

				
					Name (Name):
Example: libero