Andamio LogoAndamio
Andamio API/Authentication

User Login

Authentication

This endpoint authenticates a user using their alias and wallet address. Upon successful authentication, a new JWT (JSON Web Token) is returned for subsequent API requests.

POST
/auth/login

Login Request Body - Contains the user's alias and wallet address for authentication.

aliasstring
Length3 <= length <= 50
wallet_address?string
Length103 <= length <= 108

Response Body

curl -X POST "https://andamio-api-308006323670.us-central1.run.app/api/v1/auth/login" \
  -H "Content-Type: application/json" \
  -d '{
    "alias": "johndoe"
  }'
const body = JSON.stringify({
  "alias": "johndoe"
})

fetch("https://andamio-api-308006323670.us-central1.run.app/api/v1/auth/login", {
  body
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
  "strings"
)

func main() {
  url := "https://andamio-api-308006323670.us-central1.run.app/api/v1/auth/login"
  body := strings.NewReader(`{
    "alias": "johndoe"
  }`)
  req, _ := http.NewRequest("POST", url, body)
  req.Header.Add("Content-Type", "application/json")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://andamio-api-308006323670.us-central1.run.app/api/v1/auth/login"
body = {
  "alias": "johndoe"
}
response = requests.request("POST", url, json = body, headers = {
  "Content-Type": "application/json"
})

print(response.text)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.time.Duration;
import java.net.http.HttpRequest.BodyPublishers;

var body = BodyPublishers.ofString("""{
  "alias": "johndoe"
}""");
HttpClient client = HttpClient.newBuilder()
  .connectTimeout(Duration.ofSeconds(10))
  .build();

HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
  .uri(URI.create("https://andamio-api-308006323670.us-central1.run.app/api/v1/auth/login"))
  .header("Content-Type", "application/json")
  .POST(body)
  .build();

try {
  HttpResponse<String> response = client.send(requestBuilder.build(), BodyHandlers.ofString());
  System.out.println("Status code: " + response.statusCode());
  System.out.println("Response body: " + response.body());
} catch (Exception e) {
  e.printStackTrace();
}
using System;
using System.Net.Http;
using System.Text;

var body = new StringContent("""
{
  "alias": "johndoe"
}
""", Encoding.UTF8, "application/json");

var client = new HttpClient();
var response = await client.PostAsync("https://andamio-api-308006323670.us-central1.run.app/api/v1/auth/login", body);
var responseBody = await response.Content.ReadAsStringAsync();
{
  "alias": "johndoe",
  "jwt": {
    "expires_at": "2025-09-01T23:59:59Z",
    "token": "eyJhbGci..."
  },
  "tier": "Free",
  "user_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef"
}
{
  "details": "string",
  "message": "Bad Request: Invalid input.",
  "statusCode": 400
}
{
  "details": "string",
  "message": "Unauthorized: Invalid or missing credentials.",
  "statusCode": 401
}
{
  "details": "string",
  "message": "Forbidden: Insufficient permissions or tier access.",
  "statusCode": 403
}
{
  "details": "string",
  "message": "Unprocessable Entity: Invalid request structure or data.",
  "statusCode": 422
}
{
  "details": "string",
  "message": "Too Many Requests: Rate limit or quota exceeded.",
  "statusCode": 429
}
{
  "details": "string",
  "message": "Internal Server Error: An unexpected error occurred.",
  "statusCode": 500
}