developer portal

Documentation

edgeSDK JSON RPC APIs

mimik provides edgeSDK JSONRPC APIs for developers to create custom solutions for:

  • authentication and authorization
  • remove authentication and authorization
  • update GPS signal to cloud APIs
  • retrieve device HMAC code

getMe

Description

returns the edgeSDK attributes currently being used for the instance of the edgeSDK.

Parameters

none

Returns

object - edgeSDK attributes

Property Type Description
nodeId string The node ID given to device running the edgeSDK.
accountId string The account ID that is currently being associated to this instance of edgeSDK. Empty if no account is associated.
name string The name of the device that is currently used to identify the device running edgeSDK.
version string The version of the edgeSDK.

Example Request

curl -d '{
    "jsonrpc": "2.0",
    "method": "getMe",
    "params": [""]
}' -H "Content-Type: application/json" -X POST "http://localhost:8083/jsonrpc/v1"

Example Response

{
  "id": "1",
  "jsonrpc": "2.0",
  "nodeId": "123e4567-e89b-12d3-a456-426655440000",
  "accountId": "A123456789",
  "name": "IoT Devices"
  "version": "2.0"
}

 

getEdgeIdToken

Description

edgeIdToken is used in the process of associating or unassociating an account to the instance of running the edgeSDK.

Parameters

none

Returns

object - edgeSDK ID token.

Property Type Description
id_token string The ID token.

Example Request

curl -d '{
    "jsonrpc": "2.0",
    "method": "getEdgeIdToken",
    "params": [""]
}' -H "Content-Type: application/json" -X POST "http://localhost:8083/jsonrpc/v1"

Example Response

{
    "id": null,
    "jsonrpc": "2.0",
    "result": {
        "id_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1NzM1OTgxMDAsImp0aSI6IlJWdlBYdzA4dzNCTzhZUnFNdnRmIiwibm9kZV9pZCI6ImU3MTMzMmM1YjA1ZjY2ODBhYWRmYWZiNGE1NjNkYWFhZGZhc2Y2ZGQ1Yzg5M2U3MGNhYWMwMTU2ZDM1MCIsIm5vZGVfbmFtZSI6ImV4YW1wbGUtbWFjaGluZSIsInN1YiI6IiJ9.aamym5w-vG-qtz_MT60pcXMpqE5NTE5RY7kr8UD0B5o"
    }
}

 

associateAccount

Description

This api is used to associate edgeSDK to the account indicated in edgeToken.

Parameters

Parameter Type Description
edgeAccessToken string JWT token to verify the edgeSDK's ownership to mimik backend

Returns

object - edgeSDK account ID.

Property Type Description
accountId string The account ID.

Example Request

curl -d '{
    "jsonrpc": "2.0",
    "method": "associateAccount",
    "params": ["eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyNDY2Njg4Nzk5MDg4NzQ2NDk2IiwianRpIjoiZDcwVDN0V35mODNYbWpOenhYQlhmbU9RdFBFQ2RvekoxTDB-T0NNd350MSIsImNsaWVudF9pZCI6IjEyMzQ1ZC1jYTBkLTQ1NWMtYmE5Ny1hODAyOWIzMjNkZiIsImF6cCI6IkExMjM0NTY4OSIsImlzcyI6Imh0dHBzOi8vbWlkLm1pbWlrMzYwLmNvbS9tSUQvdjEvb2F1dGgvdG9rZW4iLCJub2RlX2lkIjoiZTcxMzMyYzViMDVmNjY4MGFhZGY0YTU2M2RhYTZkZDVjODkzZTcwY2FhYzAxNTZkMzUwIiwiYXVkIjpbImh0dHBzOi8vbWltaWsiLCJodHRwczovL21zdC5taW1pazM2MC5jb20vbVNUL3YxL2NsaWVudHMvR2VuZXJpYy1lZGdlIl0sInNjb3BlIjoiZWRnZTptY20gZWRnZTpjbHVzdGVycyBlZGdlOmFjY291bnQ6YXNzb2NpYXRlIG9wZW5pZCBlZGdlOnJlYWQ6YWNjb3VudGtleSIsImlhdCI6MTU3MzU5NzgzNCwiZXhwIjoxNTgxMzczODM0fQ.KRIeZT6-p8P3NIde42sHCqRifFPtBhipUTes1UOKoBE"]
}' -H "Content-Type: application/json" -X POST "http://localhost:8083/jsonrpc/v1"

Example Response

{
    "id": null,
    "jsonrpc": "2.0",
    "result": {
        "accountId": "12345689101112131"
    }
}

 

unassociateAccount

Description

This api is used to unassociate the edgeSDK to the account indicated in the unassociate_edgeToken.

Parameters

Parameter Type Description
unassociate_edgeAccessToken string JWT token to verify the edgeSDK's ownership to mimik backend with unassociation scope

Returns

object - edgeSDK account ID.

Property Type Description
accountId string The account ID.

Example Request

curl -d '{
    "jsonrpc": "2.0",
    "method": "unassociateAccount",
    "params": ["eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyNDY2Njg4Nzk5MDg4NzQ2NDk2IiwianRpIjoiZDcwVDN0V35mODNYbWpOenhYQlhmbU9RdFBFQ2RvekoxTDB-T0NNd350MSIsImNsaWVudF9pZCI6IjEyMzQ1ZC1jYTBkLTQ1NWMtYmE5Ny1hODAyOWIzMjNkZiIsImF6cCI6IkExMjM0NTY4OSIsImlzcyI6Imh0dHBzOi8vbWlkLm1pbWlrMzYwLmNvbS9tSUQvdjEvb2F1dGgvdG9rZW4iLCJub2RlX2lkIjoiZTcxMzMyYzViMDVmNjY4MGFhZGY0YTU2M2RhYTZkZDVjODkzZTcwY2FhYzAxNTZkMzUwIiwiYXVkIjpbImh0dHBzOi8vbWltaWsiLCJodHRwczovL21zdC5taW1pazM2MC5jb20vbVNUL3YxL2NsaWVudHMvR2VuZXJpYy1lZGdlIl0sInNjb3BlIjoiZWRnZTptY20gZWRnZTpjbHVzdGVycyBlZGdlOmFjY291bnQ6dW5hc3NvY2lhdGUgb3BlbmlkIGVkZ2U6cmVhZDphY2NvdW50a2V5IiwiaWF0IjoxNTczNTk3ODM0LCJleHAiOjE1ODEzNzM4MzR9.C7_fvjJc8NsE5CZmqCZmI3SNPQRWs-AYLttXf5Unr4Y"]
}' -H "Content-Type: application/json" -X POST "http://localhost:8083/jsonrpc/v1"

Example Response

{
    "id": null,
    "jsonrpc": "2.0",
    "result": {
        "accountId": "12345689101112131"
    }
}

 

updateGps

Description

This api gives edgeSDK and mimik edgeSDK discovery service record the location of device.

Parameters

Parameter Type Description
edgeAccessToken string JWT token to verify the edgeSDK's ownership to mimik backend
longitude string ( unit: decimal ) longitude component of GPS signal
latitude string ( unit: decimal ) latitude component of GPS signal
speed string ( unit: m/s ) speed component of GPS signal
bearing string ( unit: degree ) bearing component of GPS signal

Returns

object - status of request.

Property Type Description
id string The JSONRPC call ID.
jsonrpc string The JSONRPC API version.
result.status string The JSONRPC request status, 'ok' means successfully updated.

Example Request

curl -d '{
    "jsonrpc": "2.0",
    "method": "updateGps",
    "params": ["eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyNDY2Njg4Nzk5MDg4NzQ2NDk2IiwianRpIjoiZDcwVDN0V35mODNYbWpOenhYQlhmbU9RdFBFQ2RvekoxTDB-T0NNd350MSIsImNsaWVudF9pZCI6IjEyMzQ1ZC1jYTBkLTQ1NWMtYmE5Ny1hODAyOWIzMjNkZiIsImF6cCI6IkExMjM0NTY4OSIsImlzcyI6Imh0dHBzOi8vbWlkLm1pbWlrMzYwLmNvbS9tSUQvdjEvb2F1dGgvdG9rZW4iLCJub2RlX2lkIjoiZTcxMzMyYzViMDVmNjY4MGFhZGY0YTU2M2RhYTZkZDVjODkzZTcwY2FhYzAxNTZkMzUwIiwiYXVkIjpbImh0dHBzOi8vbWltaWsiLCJodHRwczovL21zdC5taW1pazM2MC5jb20vbVNUL3YxL2NsaWVudHMvR2VuZXJpYy1lZGdlIl0sInNjb3BlIjoiZWRnZTptY20gZWRnZTpjbHVzdGVycyBlZGdlOmFjY291bnQ6dW5hc3NvY2lhdGUgb3BlbmlkIGVkZ2U6cmVhZDphY2NvdW50a2V5IiwiaWF0IjoxNTczNTk3ODM0LCJleHAiOjE1ODEzNzM4MzR9.C7_fvjJc8NsE5CZmqCZmI3SNPQRWs-AYLttXf5Unr4Y", "49.283820", "-123.111591", "3.0", "40"]
}' -H "Content-Type: application/json" -X POST "http://localhost:8083/jsonrpc/v1"

Example Response

{
    "id": null,
    "jsonrpc": "2.0",
    "result": {
        "status": "ok"
    }
}

 

Need more help?

Feel free to contact us on stack overflow or send us a question via our support page if you have any questions.

Was this page helpful?