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,
On the first part of your question, did you looked into our nice documentation available on this link: https://docs.dataminer.services/develop/schemadoc/Protocol/Protocol.HTTP.html
On the question linked to the token expire and status code 401. This is depending on the connectors logic what it will do. If you implemented a way to retry or when the token expires to reestablish the token then yes. If you have a connector only contain the http session about without any logic that will indicate to perform actions depending on the status code or when the token is expired. This will not automatically been performed. You will need to implement this.
A good way to make sure you know all the know-hows for connector development, I can recommend you to have a look at these certifications: