Tutorial
Pre-commissioning
-
Authenticate on JS portal with JS subscriber account.
-
Select KeyManager ID in application listing.
-
Retrieve accessCode then bootstrap KeyManager.
-> You will be able to pre-commission a device.
Authenticate on Portal
Request
POST https://activation.thingpark.com/portal/rest/subscribers/authenticate HTTP/1.1
Content-Type: application/json
{"login": "username", "password": "password"}
Response
HTTP/1.1 200 OK
Set-Cookie: JSESSIONID=6s-7MUo7LkluTYdYvr8Zh5fcRQeapq6z0voTzf3C.localhost; path=/portal
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:authenticate xmlns:ns2="http://www.actility.com/portal/ws">
<sessionToken>917ec2a4da24fca0ab0c2ffb2387add1</sessionToken>
<href>/portal/rest/subscribers/100000074</href>
<state>SUCCESS</state>
</ns2:authenticate>
List all subscribed applications
Request
GET https://activation.thingpark.com/portal/rest/subscribers/100000074/applications?sessionToken=917ec2a4da24fca0ab0c2ffb2387add1&JSESSIONID=6s-7MUo7LkluTYdYvr8Zh5fcRQeapq6z0voTzf3C.localhost HTTP/1.1
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"briefs": {
"brief": [
{
"name": "key-manager",
"commercialName": "",
"ID": "actility-sup/key-manager",
"place": {
"personalName": "Default",
"ID": "170"
},
"logo": "/thingpark/smp/rest/resources/files/logo/application/130",
"grantedPermission": null,
"claimedPermission": null,
"state": {
"value": "ACTIVE",
"timestamp": 1535117784016,
"info1": null
},
"presentationStatus": "SHOWN",
"widgetActivated": true,
"href": "/portal/rest/subscribers/100000074/applications/174:722"
},
{
"name": "Wireless Logger",
"commercialName": "Wireless Logger",
"ID": "actility-sup/wlogger",
"place": {
"personalName": "Default",
"ID": "170"
},
"logo": "/thingpark/smp/rest/resources/files/logo/application/102",
"grantedPermission": null,
"claimedPermission": null,
"state": {
"value": "ACTIVE",
"timestamp": 1535117784254,
"info1": null
},
"presentationStatus": "SHOWN",
"widgetActivated": true,
"href": "/portal/rest/subscribers/100000074/applications/174:723"
},
{
"name": "JS License Manager",
"commercialName": "JS License Manager",
"ID": "js-cs/license-manager",
"place": {
"personalName": "Default",
"ID": "170"
},
"logo": "/thingpark/smp/rest/resources/files/logo/application/127",
"grantedPermission": null,
"claimedPermission": null,
"state": {
"value": "ACTIVE",
"timestamp": 1535117784309,
"info1": null
},
"presentationStatus": "SHOWN",
"widgetActivated": false,
"href": "/portal/rest/subscribers/100000074/applications/174:724"
}
]
},
"more": false
}
Retrieve accessCode
Request
GET https://activation.thingpark.com/portal/rest/subscribers/100000074/applications/174:722/views/portal?sessionToken=917ec2a4da24fca0ab0c2ffb2387add1&JSESSIONID=6s-7MUo7LkluTYdYvr8Zh5fcRQeapq6z0voTzf3C.localhost HTTP/1.1
Response
HTTP/1.1 200 OK
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:view xmlns:ns2="http://www.actility.com/portal/ws">
<accessCode>YT1hY3RpbGl0eS1zdXAva2V5LW1hbmFnZXI7YWk9NzIyO2U9dHBrLTEwMDAwMDQxOTtoPTIwNjI4NDdiZGQ5YTQ1Y2Q5MzFkYzE5YjM2ZmQ3YjM3ZDM0NDAwMmMzOGU5YjM4NjVjYzI1ZTZlNDQ2NmNmYz I7dD0yMDE5LTAyLTExVDE1OjQzOjU1LjAxMFo=</accessCode>
<href>https://js.labs.thingpark.com/keyManager/?subscriptionAccessCode=YT1hY3RpbGl0eS1zdXAva2V5LW1hbmFnZXI7YWk9NzIyO2U9dHBrLTEwMDAwMDQxOTtoPTIwNjI4NDdiZGQ5YTQ1Y2Q5MzFkYzE5YjM2ZmQ3YjM3ZDM0NDAwMmMzOGU5YjM4NjVjYzI1ZTZlNDQ2NmNmYzI7dD0yMDE5LTAyLTExVDE1OjQzOjU1LjAxMFo=</href>
</ns2:view>
Bootstrapping KeyManager
Request
GET https://activation.thingpark.com/thingpark/wireless/rest/kmCustomers?subscriptionAccessCode=YT1hY3RpbGl0eS1zdXAva2V5LW1hbmFnZXI7YWk9NzIyO2U9dHBrLTEwMDAwMDQxOTtoPTIwNjI4NDdiZGQ5YTQ1Y2Q5MzFkYzE5YjM2ZmQ3YjM3ZDM0NDAwMmMzOGU5YjM4NjVjYzI1ZTZlNDQ2NmNmYzI7dD0yMDE5LTAyLTExVDE1OjQzOjU1LjAxMFo=&JSESSIONID=5WoGQnMmSB1iGzrIUcVDnXWsxeo-1Nf2aT-hONkk.localhost HTTP/1.1
Response
HTTP/1.1 200 OK
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<kmCustomers>
<disclaimerRequired>false</disclaimerRequired>
<sessionToken>13e9bc9c394c3030</sessionToken>
<subscription>
<href>/kmSubscriptions/8</href>
</subscription>
<user>
<firstName> </firstName>
<lastName> </lastName>
<language>en-US</language>
</user>
</kmCustomers>
Pre-commission device
Request
POST https://activation.thingpark.com/thingpark/wireless/rest/kmSubscriptions/8/devices?sessionToken=13e9bc9c394c3030 HTTP/1.1
Content-Type: application/json
{
"EUI": "F03D291000110042",
"appEUI": "F03D29AC71000000",
"customerAdminData": "test",
"hsmGroupID": "HSM_JS-OPE.3",
"name": "test",
"secureElement": {
"lorawanVersion": "1.0",
"tkmInfo": "1101f03d291000110005"
},
"state": "PRE_COMMISSIONED"
}
Response
HTTP/1.1 201 Created
Content-Type: application/xml
Location: /thingpark/wireless/rest/kmSubscriptions/8/devices/588
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:device xmlns:ns2="http://www.actility.com/tpkwrls/ws/kmsubscription">
<now>2019-02-11T16:17:09.858Z</now>
<occContext>
<version>0</version>
<lastUpdate>2019-02-11T16:17:09.852Z</lastUpdate>
<who> </who>
</occContext>
<name>test</name>
<EUI>F03D291000110007</EUI>
<appEUI>F03D29AC71000004</appEUI>
<appKey>23a987975de90b66aa4d14cb3f728180</appKey>
<hsmGroupID>HSM_JS-OPE.3</hsmGroupID>
<customerAdminData>test</customerAdminData>
<historyJoinReqDaily/>
<historyJoinAnsDaily/>
<creationDate>2019-02-11T16:17:09.809Z</creationDate>
<state>PRE_COMMISSIONED</state>
<ownerToken>**1101F03D291000110005**</ownerToken>
</ns2:device>