M Token

Authorization token for MClimate LoRaWAN Broker

Create M Token

Scope: Trusted

Request URL:

POST /lorawan/create-m-token

Headers:

Content-Type: application/json
Authorization: Bearer {access_token}

Body:

{
    "name": "test-token"
}

Response:

{
    "lorawan": {
        "m_token": "525932396f6666696365407365656d656c697373612e636f6d4e455452",
        "id": "63bff8d9acf3947c56093fb4",
        "created_at": "2023-01-12 14:11:05"
    },
    "_links": {
        "self": {
            "href": "/v1/lorawan/create-m-token"
        }
    }
}

Fetch All M Tokens

Scope: Trusted

Request URL:

GET /lorawan/fetch-m-tokens

Headers:

Content-Type: application/json
Authorization: Bearer {access_token}

Response:

{
    "_embedded": {
        "lorawan": [
            {
                "id": "63bd55cae6f2376c980d3952",
                "name": "test-token",
                "created_at": "2023-01-10 14:10:50",
                "_links": {
                    "self": {
                        "href": "/v1/lorawan/fetch-m-tokens"
                    }
                }
            }
        ]
    },
    "total": 1,
    "_links": {
        "self": {
            "href": "/v1/lorawan/fetch-m-tokens"
        }
    }
}

Delete M token

Scope: Trusted

Request URL:

DELETE /lorawan/delete-m-token/{m_token id}

Headers:

Content-Type: application/json
Authorization: Bearer {access_token}

Response:

{
    "lorawan": {
        "id": "63bd858fe6f2376c980d3953"
    },
    "_links": {
        "self": {
            "href": "/v1/lorawan/delete-m-token/63bd858fe6f2376c980d3953"
        }
    }
}

Last updated