POST Authentication

This API will authenticate the user and will generate unique token which will be valid for 24 hours.

Request Attributes

API Content Type: JSON

body

ATTRIBUTE DESCRIPTION
client_id
string(52)
mandatory
It is base64 of the app-key.
Example: ZmE1MjAI3Nzc4MmUyYjYtZTtyMDE4NIY0ZS00MTY3LWNjTM1Ng==
authorization_id
string(56)
mandatory
It is encrypted UserId.
Example: yPjcJL1eRuyLHrJaDJMeLu6ORe8xl2NYd63qFp+IJkRUp4UjpDGxJw==

Response Attributes

API Content Type: JSON

body

ATTRIBUTE DESCRIPTION
statuscode
string(3)
This is the status code corresponding to a particular message and is returned to the user. The different status codes corresponding to this API are mentioned below
Example: 200
status
boolean
This parameter indicates the status of API call.
Possible Values: true or false
Token
string
Unique Token generated in reponse of this API. It is valid for 24 hours and user has to send back the same token everytime in each subsequent API Call for communication.
Example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.TU5NzgyMDA1N30.9eO_xh eyJEYXRhIjp7InVzZXJpZCI6IjY3NCIsImVtYWlsIjoiYWFhYWFhYWFhYWjuunGJQ YmwuY29tIiwia2V5IjoidGVzdGluZ0tleSJ9LCJpYXQiOjE1OTc3NDA4NTpj6gc8dM csIFhY7n1mV4cUBxa2P3ICI6M2VyWq19OzuHAefeTEj

Response Codes and Messages

statuscode status Description
200
true
Success
401
false
Your Session has expired
409
false
Conflict has occured
422
false
Invalid parameter
500
false
System error
https://console.konsign.com/api/oauth/auth
https://console.konsign.com/api/oauth/auth
REQUEST RESPONSE
												const https = require('https');
													var authParam = {};

													authParam.body = {
														  'client_id' :'YOUR CLIENT ID'
														  'authorization_id' : 'YOUR AUTHORIZATION ID'
													}

													var postData = JSON.stringyfy(authParam);

													var options = {
														  hostname: console.konsign.com,
														  port: 443,
														  path: '/api/oauth/auth'
														  method: 'POST',
														  headers:{
															    'Content-Type' : 'application/json'
															    'Content-Length' : postData.length
															  }
													}
													var response = "";

    												var post_req = https.request(options, function(post_res) {

	        										  post_res.on('data', function (chunk) {
													    response += chunk;
													
        											  });

        											  post_res.on('end', function(){
            										    console.log('Response: ', response);
        											  });
    												});

    												post_req.write(post_data);
    												post_req.end();
												
											
												Dictionary <string, object> body = new Dictionary<string, object>();
													Dictionary <string, object> requestBody = new Dictionary<string, object>();

													body.Add("client_id" : "YOUR CLIENT ID");
													body.Add("authorization_id" : "YOUR AUTHENTICATION ID");

													requestBody.Add("body", body);

													string post_data = JsonConvert.SerializeObject(requestBody);

													string url = "https://console.konsign.com/api/oauth/auth";
													
													HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);

													webRequest.Method = "POST";
													webRequest.ContentType = "application/json";
													webRequest.ContentLength = post_data.Length;

													using (StreamWriter requestWriter = new StreamWriter(webRequest.GetRequestStream()))
													{
														  requestWriter.Write(post_data);
													}

													string responseData = string.Empty;

													using (StreamReader responseReader = new StreamReader(webRequest.GetResponse().GetResponseStream()))
													{
														  responseData = responseReader.ReadToEnd();
														  Console.WriteLine(responseData);
													}
												
											
												{
													"head": {
														"responseTimestamp": "1526969112101",
														"version": "v1",
														"clientId": "C11",
														"signature": "TXBw50YPUKIgJd8gR8RpZuOMZ+csvCT7i0/YXmG//J8+BpFdY5goPBiLAkCzKlCkOvAQip/Op5aD6Vs+cNUTjFmC55JBxvp7WunZ45Ke2q0="
													},
													"body": {
														"resultInfo": {
															"resultStatus": "S",
															"resultCode": "0000",
															"resultMsg": "Success"
														},
														"txnToken": "fe795335ed3049c78a57271075f2199e1526969112097",
														"isPromoCodeValid": false,
														"authenticated": false
													}
												}