Authenticate using Token
Authentication using Token
For token authentication, we are using Token based authentication system. You can make API requests over HTTP and authenticate using Token.
Note
Users who would like to access the resource over HTTP/API on their Frontend application, will at least has to have an account on the EngineerForce platform.
Let's assume you have two things here.
- A resouce that you would like to access is something similar to the following Endpoint.
- You have already generated the API Token with your accounts. (Please keep in mind that every token is depends on the creator account). The token will has full access as the creator account.
Example Endpoint
This route usually returns information related to the user who is currently making the Request
Example Request
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
String credential = "API-Token " + {{YOUR_API_TOKEN}};
Request request = new Request.Builder()
.url({{ENDPOINT}})
.method("GET", body)
.header("Authorzation", credential)
.build();
Response response = client.newCall(request).execute();