IoT Stadium

API Documentation

Device Location

Device Location - POST Add Location

Adding the new location

Post
{{url_iot_backend}}/ext/locations
    {
      "key": "Content-Type",
      "value": "application/json"
    },
    {
      "key": "Authorization",
      "value": "Bearer {{token}}"
    }

Parameter

Field Type Description
location_name Text

The name of your new location (Required)

coord_lat Number

The latitude coordinate of your new location (Max 128 characters)

coord_long Number

The longitude coordinate of your new location (Max 128 characters)

description Text

The description of your location

address Text

The address of your location

custom_field Text

The additional detail of your location

{
    "location_name": "univ kartini", 
    "coord_lat": -7.300780302855874, 
    "coord_long": 112.7624434232712, 
    "description": "test device location", 
    "address": "nginden raya, sukolilo, surabaya", 
    "custom_field": [ 
        {
            "id": null,
            "key": "Univ",
            "parent_id": null,
            "child": [
                {
                    "key": "lab kom",
                    "id": null,
                    "parent_id": -70,
                    "child": [
                        {
                            "key": "ruang server",
                            "id": null,
                            "parent_id": -109,
                            "child": []
                        }
                    ]
                }
            ]
        }
    ]
}                                            
{
    "message": "location created",
    "data": {
        "id": 173
    },
    "code": 200
}
{
    "message": "Invalid Message",
    "code": 400,
    "errors": [
        {
            "field": "location_name",
            "message": "The location name field is required.."
        },
        {
            "field": "description",
            "message": "The description may not be greater than 128 characters."
        }
    ]
}                                                
{
    "message": "Invalid Message",
    "code": 400,
    "errors": [
        {
            "field": "location_name",
            "message": "The location name field is required.."
        },
        {
            "field": "description",
            "message": "The description may not be greater than 128 characters."
        }
    ]
}