Your application must use the Login API to authenticate with the ThingSpace Platform and receive a session token before it can make any other requests. This tutorial shows the basic steps involved, as carried out in SoapUI.
Navigate to SessionService > LogIn API and open a new request.
The response includes a session token.
You must include the token in the token field in the header of all API session requests following login. Here is a sample SOAP header showing the session token in bold.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://nphase.com/unifiedwebservice/v2" ... <soapenv:Header> <v2:token>0981e063-b2b0-4b47-bb28-7dea88a76fb4</token> </soapenv:Header>
Session tokens expire after 20 minutes of no activity. If a token expires, your application must authenticate again to obtain a new token. If you try to use an expired token, you will receive a fault stating that "The session has expired."