-
Notifications
You must be signed in to change notification settings - Fork 3
Code Example Authentication
Timothy Jay edited this page Aug 19, 2025
·
2 revisions
The following are examples of Authentication to the Impact API using various different programming languages.
// create a new HttpClient to make the Request
using var client = new HttpClient();
// setup your Implan credentials
var credentials = new Credentials
{
Username = "{username}",
Password = "{password}"
};
// POST the request to the auth endpoint
using var response = await client.PostAsJsonAsync("https://api.implan.com/api/auth", credentials);
// the response wil be the bearer token in the form
// "Bearer {token}"
string token = await response.Content.ReadAsStringAsync();
Console.WriteLine(token);
// need some class to hold the credentials
public class Credentials
{
public string Username { get; set; }
public string Password { get; set; }
}
import requests
from requests import Response
# The API Auth Endpoint
url: str = "https://api.implan.com/api/auth"
# Credentials to be sent
credentials: dict = {
"username": "{username}",
"password": "{password}"
}
# POST the request
response: Response = requests.post(url, json=credentials)
# The response will be 'Bearer {token}'
token: str = response.content.decode("utf-8")
print(token)
library(RCurl)
headers = c(
"Content-Type" = "text/plain"
)
params = "{ \"username\": \"{username}\", \"password\": \"{password}\" }\r\n"
res <- postForm("https://api.implan.com/api/auth", .opts=list(postfields = params, httpheader = headers, followlocation = TRUE), style = "httppost")
cat(res)
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.implan.com/api/auth")
.header("Content-Type", "text/plain")
.body("{ \"username\": \"\", \"password\": \"\" }\r\n")
.asString();
© 2025 - IMPLAN