DX STF Client API

<back to all web services

GetAuthToken

Auth Requests

Auth

The following routes are available for this service:
POST/api/authentication/tokenGet Bearer access token, contact support for credentials
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;

public class dtos
{

    /**
    * Auth
    */
    @Api(Description="Auth")
    @ApiResponse(Description="Access token response", IsDefaultResponse=true, StatusCode=200)
    public static class GetAuthToken
    {
        /**
        * Post parameters in body
        */
        @ApiMember(Description="Post parameters in body", ParameterType="model")
        public String clientId = null;

        /**
        * Post parameters in body
        */
        @ApiMember(Description="Post parameters in body", ParameterType="model")
        public String clientSecret = null;

        /**
        * Post parameters in body
        */
        @ApiMember(Description="Post parameters in body", ParameterType="model")
        public String scope = null;
        
        public String getClientId() { return clientId; }
        public GetAuthToken setClientId(String value) { this.clientId = value; return this; }
        public String getClientSecret() { return clientSecret; }
        public GetAuthToken setClientSecret(String value) { this.clientSecret = value; return this; }
        public String getScope() { return scope; }
        public GetAuthToken setScope(String value) { this.scope = value; return this; }
    }

    public static class AccessTokenResponse
    {
        public String accessToken = null;
        public String scope = null;
        public String tokenType = null;
        public Integer expiresIn = null;
        public Integer httpStatusCode = null;
        public String httpErrorReason = null;
        public String error = null;
        
        public String getAccessToken() { return accessToken; }
        public AccessTokenResponse setAccessToken(String value) { this.accessToken = value; return this; }
        public String getScope() { return scope; }
        public AccessTokenResponse setScope(String value) { this.scope = value; return this; }
        public String getTokenType() { return tokenType; }
        public AccessTokenResponse setTokenType(String value) { this.tokenType = value; return this; }
        public Integer getExpiresIn() { return expiresIn; }
        public AccessTokenResponse setExpiresIn(Integer value) { this.expiresIn = value; return this; }
        public Integer getHttpStatusCode() { return httpStatusCode; }
        public AccessTokenResponse setHttpStatusCode(Integer value) { this.httpStatusCode = value; return this; }
        public String getHttpErrorReason() { return httpErrorReason; }
        public AccessTokenResponse setHttpErrorReason(String value) { this.httpErrorReason = value; return this; }
        public String getError() { return error; }
        public AccessTokenResponse setError(String value) { this.error = value; return this; }
    }

}

Java GetAuthToken DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /api/authentication/token HTTP/1.1 
Host: stf-api-uat.data-xchange.co.za 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"clientId":"String","clientSecret":"String","scope":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"accessToken":"String","scope":"String","tokenType":"String","expiresIn":0,"httpStatusCode":0,"httpErrorReason":"String","error":"String"}