Logout
Upon completion of this API call, the session will be terminated, rendering the access token invalid. As a result, the user will be required to log in again to establish a new session and obtain a new access token.
Method: POST
https://connect.thefirstock.com/api/V3/logout
Request details
Parameter | Description | Data types | Examples |
---|---|---|---|
userId | User Id of the login user | String | "AA1999" |
jKey | Token received from login API | String | "d9b4e1b1c79042476fd96 11eed81003b2dc34c3f13b0 b60a4842fd5a24c9f3f2" |
- cURL
curl --location --request POST 'https://connect-dev.thefirstock.com/api/V3/logout' \
--header 'Content-Type: application/json' \
--data-raw '{
"jKey": "e6a211bea63adff386578988e1cf4a9521c4744e6a39ad63174c8797e2af8c38",
"userId": "AA123"
}'
from thefirstock import thefirstock
logout = thefirstock.firstock_logout()
const Firstock = require("thefirstock");
const firstock = new Firstock();
firstock.logout((err, result) => {
console.log("Error, ", err);
console.log("Result: ", result);
});
using thefirstock;
class Program
{
public static void Main()
{
Firstock firstock = new Firstock();
var logout = firstock.logout();
}
}
Success response details
Parameter | Description | Data types | Examples |
---|---|---|---|
status | Success | String | "Success" |
data | Give a successful logout message | String | "Successfully logged out" |
Failure response details
Parameter | Description | Data Type | Example |
---|---|---|---|
status | Failed | String | "Failed" |
code | HTTP Code | String | "401" |
name | Type of error | String | "INVALID_JKEY" |
error.field | Error field | String | "jkey" |
error.message | Error message | String | "jKey parameter is invalid" |
Sample response
- Success response
- Failure response
{
"status": "Success",
"data": "Successfully logged out"
}
{
"status": "Failed",
"code": "401",
"name": "INVALID_JKEY",
"error": {
"field": "jKey",
"message": "jKey parameter is invalid"
}
}