Hi,
I create a protocol using http, I have doubt about how can login correctly:
this is my endpoint: api/v1/system/configuration/login
I need send:
header:
Content-Type : aplication/json
Body:
{
"user":"admin",
"password":"admin123"
}
the endpoint reply :
Body:
{
"token": "0fe99819879b419db34bb8b627a958ce", (only need this value and set in param name token)
"user": "Admin"
}
I create this session but didn't work :
<Sessionid="2"name="API Login">
<Connection id="1" name="Credentials">
<Request verb="POST" url="api/v1/system/configuration/login">
<Headers>
<Header key="Content-Type">aplication/json</Header>
<Header key="user" pid="10"></Header> (param with username )
<Header key="password" pid ="11"></Header> ( param with password )
</Headers>
</Request>
<Response status Code="2">
<Contentpid="12" ></Content>
</Response>
</Connection>
</Session>
pid 12 no have nothing I need set with token value.
what happen if token expire and status code is 401, login automatically?
thanks
Hi Jose,
I think the problem might be in the way the body is handled. You’re putting "user" and "password" in headers. But the API expects them in the JSON body, not headers.
The only header needed is Content-Type: application/json (Also note the typo: aplication/json → should be application/json).
Instead of setting the username and password in the headers, you can include them in the body using the <Parameters> tag, which automatically formats them as JSON for POST requests.
For example:
<Request verb="GET" url="Example.html">
<Parameters>
<Parameter key="a">Example value!</Parameter>
<Parameter key="b">20</Parameter>
</Parameters>
</Request>
This way, you don't need to manually construct the JSON body—DataMiner will do that for you. Just make sure the Content-Type
header is correctly set to application/json
, and the system will send a properly formatted request like:
{
"user": "admin",
"password": "admin123"
}
You can find more info here: Implementing HTTP communication | DataMiner Docs
You also asked "What happens if token expires and status code is 401?
At the moment, nothing happens automatically. You’ll need to handle that manually by detecting the 401 response and triggering a new login request to get a fresh token.

Hi Nejra,
Thanks for the quick reply. It's now clear how to create the request body.
This is the response I get from the login endpoint:
{
"token": "0fe99819879b419db34bb8b627a958ce",
"user": "Admin"
}
How can I extract and store only the token value into PID 12?
Thanks!