Users
Get user details
GET
/v1/usersRetrieve details of a user. Admin role required to view other users.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | integer | Required | User ID to retrieve |
Code Examples
curl -H "access-token: {{token}}" \ "https://apistage.projectexpedition.com/v1/users?user_id=12345"const response = await fetch('https://apistage.projectexpedition.com/v1/users?user_id=12345', { headers: { 'access-token': 'YOUR_TOKEN' }});
const data = await response.json();<?php$context = stream_context_create([ 'http' => [ 'method' => 'GET', 'header' => "access-token: YOUR_TOKEN" ]]);
$response = file_get_contents('https://apistage.projectexpedition.com/v1/users?user_id=12345', false, $context);$data = json_decode($response, true);Responses
200 User details
{ "status": "Active", "user_id": 12345, "first_name": "Sarah", "last_name": "Johnson", "email": "sarah@travelagency.com"}400 User not found or access denied
Create a new user
POST
/v1/usersCreate a new travel agent user under your organization.
Requirements:
- Requires Admin role
- Parent user must have valid IATA/accreditation
Request Body
Required
Code Examples
curl -X POST \ -H "access-token: {{token}}" \ -H "Content-Type: application/json" \ -d '{ "email": "newagent@travelagency.com", "first_name": "Jane", "last_name": "Doe", "password": "securePassword123", "agency_name": "Doe Travel Agency", "website": "https://doetravelagency.com", "phone": "+1 555 987 6543", "address": "123 Main Street, New York, NY 10001, USA", "make_api_token": 1 }' \ "https://apistage.projectexpedition.com/v1/users"const response = await fetch('https://doetravelagency.com', { method: 'POST', headers: { 'access-token': 'YOUR_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ "email": "newagent@travelagency.com", "first_name": "Jane", "last_name": "Doe", "password": "securePassword123", "agency_name": "Doe Travel Agency", "website": "https://doetravelagency.com", "phone": "+1 555 987 6543", "address": "123 Main Street, New York, NY 10001, USA", "make_api_token": 1 })});
const data = await response.json();<?php$data = json_encode({ 'email': 'newagent@travelagency.com', 'first_name': 'Jane', 'last_name': 'Doe', 'password': 'securePassword123', 'agency_name': 'Doe Travel Agency', 'website': 'https://doetravelagency.com', 'phone': '+1 555 987 6543', 'address': '123 Main Street, New York, NY 10001, USA', 'make_api_token': 1 });
$context = stream_context_create([ 'http' => [ 'method' => 'POST', 'header' => "Content-Type: application/json\r\naccess-token: YOUR_TOKEN\r\nContent-Type: application/json", 'content' => $data ]]);
$response = file_get_contents('https://doetravelagency.com', false, $context);$result = json_decode($response, true);Responses
200 User created
{ "status": "success", "user_id": 12346, "access_token": "abc123def456ghi789"}400 Creation failed
{ "error": "Admin role required to create users"}Create API access for existing user
POST
/v1/users_apiaccessGenerate an API access token for an existing user.
Request Body
Required
Code Examples
curl -X POST \ -H "access-token: {{token}}" \ -H "Content-Type: application/json" \ -d '{"user_id": 12345}' \ "https://apistage.projectexpedition.com/v1/users_apiaccess"const response = await fetch('https://apistage.projectexpedition.com/v1/users_apiaccess', { method: 'POST', headers: { 'access-token': 'YOUR_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ "user_id": 12345 })});
const data = await response.json();<?php$data = json_encode({'user_id': 12345});
$context = stream_context_create([ 'http' => [ 'method' => 'POST', 'header' => "Content-Type: application/json\r\naccess-token: YOUR_TOKEN\r\nContent-Type: application/json", 'content' => $data ]]);
$response = file_get_contents('https://apistage.projectexpedition.com/v1/users_apiaccess', false, $context);$result = json_decode($response, true);Responses
200 API access created
{ "status": "success", "access_token": "xyz789abc123def456"}