Introduction
This is a standard Web API for HTTP clients to call stored procedures in the Winfreight database.
Authentication
Cookie Authentication
URL: |
http://freight.emit.co.za/WinfreightAPI/login |
HTTP REQUEST
Note: The authentication endpoint can be called by either a GET or POST request. Authentication is valid for an hour and does not need to be called for each request.
The following parameters are passed as a json string as part of the authentication request:
Parameter |
Description |
Username |
The username assigned to your account by Winfreight. |
Password |
The password assigned to your account by winfreight. |
HTTP RESPONSE
Calling the authentication will have three possible responses:
Response |
Description |
Success |
Returns a status code 200 and the message "Login Success." |
Failure |
Returns a status code 400 and the message "Username or Password invalid." |
Error |
This will return the appropriate server error message and code. |
Authentication Example
Token Authentication
URL: |
[http://freight.emit.co.za/WinfreightAPI/token |
HTTP REQUEST
Generate a token using credentials provided by Winfreight in the body of the request as shown below. The token is valid for an hour.
Pass the token in Authorisation header in subsequent api calls.