Skip to main content
POST
/
v2
/
auth
/
pre-login
Pre login
curl --request POST \
  --url https://staging.api.prexsell.com/v2/auth/pre-login \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "user@example.com",
  "password": "s3cr3tP@ssword"
}
'
import requests

url = "https://staging.api.prexsell.com/v2/auth/pre-login"

payload = {
"email": "user@example.com",
"password": "s3cr3tP@ssword"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({email: 'user@example.com', password: 's3cr3tP@ssword'})
};

fetch('https://staging.api.prexsell.com/v2/auth/pre-login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.api.prexsell.com/v2/auth/pre-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 => json_encode([
'email' => 'user@example.com',
'password' => 's3cr3tP@ssword'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$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://staging.api.prexsell.com/v2/auth/pre-login"

payload := strings.NewReader("{\n \"email\": \"user@example.com\",\n \"password\": \"s3cr3tP@ssword\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://staging.api.prexsell.com/v2/auth/pre-login")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"user@example.com\",\n \"password\": \"s3cr3tP@ssword\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://staging.api.prexsell.com/v2/auth/pre-login")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"user@example.com\",\n \"password\": \"s3cr3tP@ssword\"\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "user": {
      "id": "usr_abc123def456",
      "email": "user@example.com",
      "firstName": "ะ†ะฒะฐะฝ",
      "lastName": "ะŸะตั‚ั€ะตะฝะบะพ"
    },
    "availableAccesses": [
      {
        "contextType": "COMPANY",
        "companyId": "cmp_xyz789",
        "partnerId": null,
        "role": "ADMIN",
        "company": {
          "id": "cmp_xyz789",
          "name": "Prexsell Bus Lines",
          "slug": "prexsell-bus-lines",
          "tier": "PRO"
        }
      }
    ]
  }
}
{
"errors": [
{
"message": "AUTH_INVALID_CREDENTIALS",
"errorCode": "UNAUTHORIZED"
}
]
}

Body

application/json

Credentials for pre-login verification. Returns the list of company contexts the user can log into.

email
string<email>
required

The user's email address.

Example:

"user@example.com"

password
string
required

The user's plaintext password.

Example:

"s3cr3tP@ssword"

Response

Credentials validated. Returns the user profile and the list of companies they can log into.

data
object
required