JWT Authorization by User Credentials
curl --request POST \
--url https://api.projectcor.com/v1/auth/login \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data email=jsmith@example.com \
--data 'password=<string>'import requests
url = "https://api.projectcor.com/v1/auth/login"
payload = {
"email": "jsmith@example.com",
"password": "<string>"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({email: 'jsmith@example.com', password: '<string>'})
};
fetch('https://api.projectcor.com/v1/auth/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const encodedParams = new URLSearchParams();
encodedParams.set('email', 'jsmith@example.com');
encodedParams.set('password', '<string>');
const url = 'https://api.projectcor.com/v1/auth/login';
const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: encodedParams
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.projectcor.com/v1/auth/login",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "email=jsmith%40example.com&password=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.projectcor.com/v1/auth/login"
payload := strings.NewReader("email=jsmith%40example.com&password=%3Cstring%3E")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"access_token": "<string>",
"token_type": "<string>",
"expires_in": 123,
"refresh_token": "<string>"
}Authentication
JWT Authorization by User Credentials
POST
/
auth
/
login
JWT Authorization by User Credentials
curl --request POST \
--url https://api.projectcor.com/v1/auth/login \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data email=jsmith@example.com \
--data 'password=<string>'import requests
url = "https://api.projectcor.com/v1/auth/login"
payload = {
"email": "jsmith@example.com",
"password": "<string>"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({email: 'jsmith@example.com', password: '<string>'})
};
fetch('https://api.projectcor.com/v1/auth/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const encodedParams = new URLSearchParams();
encodedParams.set('email', 'jsmith@example.com');
encodedParams.set('password', '<string>');
const url = 'https://api.projectcor.com/v1/auth/login';
const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: encodedParams
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.projectcor.com/v1/auth/login",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "email=jsmith%40example.com&password=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.projectcor.com/v1/auth/login"
payload := strings.NewReader("email=jsmith%40example.com&password=%3Cstring%3E")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"access_token": "<string>",
"token_type": "<string>",
"expires_in": 123,
"refresh_token": "<string>"
}Was this page helpful?
⌘I

