The login service is applied to authenticate the user and retrieve a token.

  1. Introduction

    The login service is applied to authenticate the user and retrieve a token. The token is used to grant access to the other services of the DPD Integration Services. The token is valid for exactly 24 hours after authentication. This means that one call per 24 hours to the login service will give access the other services. It’s not allowed to refresh your token for each request. We will move towards a rate limiting mechanism which will limit the login attempts.

    You can cache the token and re-use it for any call within the 24 hour limit. The value in <authTokenExpires> will teel you when to request a new one. Times are indicated in UTC. The amount of login calls allowed per day is 10, so a requesting a token eacht time would technically solve the issue, but is not allowed due to unnecessary traffic and load. So please build a mechanism taking the <authTokenExpires> into account. Making 1 fixed call per day is the best practice

    Example:

    Logincall 1 on day 1 at 8:00AM: A new token ‘A’ is obtained, valid for 24 hours

      • Shipments can be created with token ‘A’

    Logincall 2 on day 1 at 11:00AM: The same token ‘A’ is obtained, still valid for 21 hours

      • Shipments can be created with token ‘A’

    Logincall 3 on day 2 at 07:30AM: The same token ‘A’ is obtained, still valid for 30 minutes

      • Shipments can be created with token ‘A’

    Logincall 4 on day 2 at 09:00AM: A new token ‘B’ is obtained, valid for 24 hours

     

    Error codes to be known if a shipment is not accepted:

    ERR_DELICOM_TOKEN_EXPIRED: The token used to make the shipment call is recognised, but older than 24 hours. It was requested longer than a day ago and thus invalid

      • Make a new Logincall

    ERR_DELICOM_TOKEN_INCORRECT: The token used to make the shipment call has the right structure, but is not recognised. It comes from another unrelated set of credentials and is very old.

      • Check related accounts and make sure the right token is used for the right account. Maybe an old previously cached token is used.

    DELICOM_ERR_AUTHENTICATION: The token used to make the shipment call does not have the right structure, it is not a 64 character alphanumerical string

      • Check the structure of your call, you might be submitting a password instead of a token (most common)

     

    Connection URLs

     

    Request parameters

    Node Data type Length Description
    <delisId> String 6-10 Your Delis ID provided by DPD.
    <password> String 17 Your password provided by DPD.
     <messageLanguage> String 5 This can be set to the default value of en_EN

     

    Response parameters

    Node Data type Description
    <delisId> String Your DelisID
    <customerUid> String Your Customer UID (usually the same as DelisID)
    <authToken> String Your Authentication Token, whch stays valid for 24h
    <depot> String The DPD depot your belong to
    <authTokenExpires> String Timestamp for last Authentication Token validity

     

    Sample call

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://dpd.com/common/service/types/LoginService/2.0">
    <soapenv:Header/>
    <soapenv:Body>
    <ns:getAuth>
    <delisId>KD*****</delisId>
    <password>*******</password>
    <messageLanguage>en_EN</messageLanguage>
    </ns:getAuth>
    </soapenv:Body>
    </soapenv:Envelope>

    Sample Response

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
    <getAuthResponse xmlns="http://dpd.com/common/service/types/LoginService/2.1">
    <return>
    <delisId>SWSTEST</delisId>
    <customerUid>SWSTEST</customerUid>
    <authToken>GFadfGob14GWWgQcIldI6zYtuR7cyEHe2z6eWzb7BpFmcFvrzclRljlcV1OF</authToken>
    <depot>0530</depot>
    <authTokenExpires>2020-05-08T13:02:56.06</authTokenExpires>
    </return>
    </getAuthResponse>
    </soap:Body>
    </soap:Envelope>

     

    Note:

    Previous version of the Login Service (v2.0) is still valid and functional. It works exactly the same except for the <authTokenExpires> ns not in the response. The token returned through both versions corresponds.  

    Live: https://wsshipper.dpd.be/soap/WSDL/LoginServiceV20.wsdl
    Stage: https://shipperadmintest.dpd.be/PublicApi/soap/WSDL/LoginServiceV20.wsdl

Was this post helpful?(Required)