446 lines
13 KiB
JSON
446 lines
13 KiB
JSON
{
|
|
"info": {
|
|
"name": "Xpeditis API Collection",
|
|
"description": "Collection complète des endpoints pour l'API Xpeditis - Plateforme de shipping maritime et logistique",
|
|
"version": "1.0.0",
|
|
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
|
|
},
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{jwt_token}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"variable": [
|
|
{
|
|
"key": "base_url",
|
|
"value": "http://localhost:8080",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"key": "jwt_token",
|
|
"value": "",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"key": "refresh_token",
|
|
"value": "",
|
|
"type": "string"
|
|
}
|
|
],
|
|
"item": [
|
|
{
|
|
"name": "🏠 Service Info",
|
|
"item": [
|
|
{
|
|
"name": "Get Service Information",
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"url": {
|
|
"raw": "{{base_url}}/",
|
|
"host": ["{{base_url}}"],
|
|
"path": [""]
|
|
}
|
|
},
|
|
"response": []
|
|
}
|
|
],
|
|
"description": "Endpoints pour récupérer les informations du service"
|
|
},
|
|
{
|
|
"name": "🔐 Authentication",
|
|
"item": [
|
|
{
|
|
"name": "Login",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"exec": [
|
|
"if (pm.response.code === 200) {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.collectionVariables.set('jwt_token', jsonData.accessToken);",
|
|
" pm.collectionVariables.set('refresh_token', jsonData.refreshToken);",
|
|
"}"
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"username\": \"user@example.com\",\n \"password\": \"Password123!\"\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{base_url}}/api/v1/auth/login",
|
|
"host": ["{{base_url}}"],
|
|
"path": ["api", "v1", "auth", "login"]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Register",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"exec": [
|
|
"if (pm.response.code === 201) {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.collectionVariables.set('jwt_token', jsonData.accessToken);",
|
|
" pm.collectionVariables.set('refresh_token', jsonData.refreshToken);",
|
|
"}"
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"username\": \"johndoe\",\n \"password\": \"Password123!\",\n \"confirmPassword\": \"Password123!\",\n \"phoneNumber\": \"+33123456789\",\n \"companyName\": \"Maritime Solutions Inc\",\n \"companyCountry\": \"France\",\n \"authProvider\": \"LOCAL\",\n \"privacyPolicyAccepted\": true\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{base_url}}/api/v1/auth/register",
|
|
"host": ["{{base_url}}"],
|
|
"path": ["api", "v1", "auth", "register"]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Google OAuth",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"exec": [
|
|
"if (pm.response.code === 200) {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.collectionVariables.set('jwt_token', jsonData.accessToken);",
|
|
" pm.collectionVariables.set('refresh_token', jsonData.refreshToken);",
|
|
"}"
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"googleToken\": \"google_oauth_token_here\",\n \"companyName\": \"Optional Company Name\",\n \"phoneNumber\": \"+33123456789\"\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{base_url}}/api/v1/auth/google",
|
|
"host": ["{{base_url}}"],
|
|
"path": ["api", "v1", "auth", "google"]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Refresh Token",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"exec": [
|
|
"if (pm.response.code === 200) {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.collectionVariables.set('jwt_token', jsonData.accessToken);",
|
|
" pm.collectionVariables.set('refresh_token', jsonData.refreshToken);",
|
|
"}"
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"refreshToken\": \"{{refresh_token}}\"\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{base_url}}/api/v1/auth/refresh",
|
|
"host": ["{{base_url}}"],
|
|
"path": ["api", "v1", "auth", "refresh"]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Logout",
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Authorization",
|
|
"value": "Bearer {{jwt_token}}"
|
|
}
|
|
],
|
|
"url": {
|
|
"raw": "{{base_url}}/api/v1/auth/logout",
|
|
"host": ["{{base_url}}"],
|
|
"path": ["api", "v1", "auth", "logout"]
|
|
}
|
|
},
|
|
"response": []
|
|
}
|
|
],
|
|
"description": "Endpoints d'authentification et gestion des sessions JWT"
|
|
},
|
|
{
|
|
"name": "👤 Profile Management",
|
|
"item": [
|
|
{
|
|
"name": "Get Profile",
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Authorization",
|
|
"value": "Bearer {{jwt_token}}"
|
|
}
|
|
],
|
|
"url": {
|
|
"raw": "{{base_url}}/api/v1/profile",
|
|
"host": ["{{base_url}}"],
|
|
"path": ["api", "v1", "profile"]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Update Profile",
|
|
"request": {
|
|
"method": "PUT",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Authorization",
|
|
"value": "Bearer {{jwt_token}}"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"firstName\": \"John Updated\",\n \"lastName\": \"Doe Updated\",\n \"phoneNumber\": \"+33987654321\",\n \"username\": \"johnupdated\"\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{base_url}}/api/v1/profile",
|
|
"host": ["{{base_url}}"],
|
|
"path": ["api", "v1", "profile"]
|
|
}
|
|
},
|
|
"response": []
|
|
}
|
|
],
|
|
"description": "Endpoints de gestion du profil utilisateur via ProfileController"
|
|
},
|
|
{
|
|
"name": "👥 User Management",
|
|
"item": [
|
|
{
|
|
"name": "Get User Profile (Alternative)",
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Authorization",
|
|
"value": "Bearer {{jwt_token}}"
|
|
}
|
|
],
|
|
"url": {
|
|
"raw": "{{base_url}}/api/v1/users/profile",
|
|
"host": ["{{base_url}}"],
|
|
"path": ["api", "v1", "users", "profile"]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Update User Profile (Alternative)",
|
|
"request": {
|
|
"method": "PUT",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Authorization",
|
|
"value": "Bearer {{jwt_token}}"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"firstName\": \"John Updated\",\n \"lastName\": \"Doe Updated\",\n \"phoneNumber\": \"+33987654321\",\n \"username\": \"johnupdated\"\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{base_url}}/api/v1/users/profile",
|
|
"host": ["{{base_url}}"],
|
|
"path": ["api", "v1", "users", "profile"]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Change Password",
|
|
"request": {
|
|
"method": "PUT",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Authorization",
|
|
"value": "Bearer {{jwt_token}}"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"currentPassword\": \"Password123!\",\n \"newPassword\": \"NewPassword123!\",\n \"confirmationPassword\": \"NewPassword123!\"\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{base_url}}/api/v1/users/password",
|
|
"host": ["{{base_url}}"],
|
|
"path": ["api", "v1", "users", "password"]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Delete Account",
|
|
"request": {
|
|
"method": "DELETE",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Authorization",
|
|
"value": "Bearer {{jwt_token}}"
|
|
}
|
|
],
|
|
"url": {
|
|
"raw": "{{base_url}}/api/v1/users/account",
|
|
"host": ["{{base_url}}"],
|
|
"path": ["api", "v1", "users", "account"]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "List Users (Admin Only)",
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Authorization",
|
|
"value": "Bearer {{jwt_token}}"
|
|
}
|
|
],
|
|
"url": {
|
|
"raw": "{{base_url}}/api/v1/users?page=0&size=10",
|
|
"host": ["{{base_url}}"],
|
|
"path": ["api", "v1", "users"],
|
|
"query": [
|
|
{
|
|
"key": "page",
|
|
"value": "0"
|
|
},
|
|
{
|
|
"key": "size",
|
|
"value": "10"
|
|
},
|
|
{
|
|
"key": "companyId",
|
|
"value": "uuid-company-id",
|
|
"disabled": true
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
}
|
|
],
|
|
"description": "Endpoints de gestion des utilisateurs - profil, mot de passe, suppression de compte"
|
|
}
|
|
],
|
|
"event": [
|
|
{
|
|
"listen": "prerequest",
|
|
"script": {
|
|
"type": "text/javascript",
|
|
"exec": [
|
|
""
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"type": "text/javascript",
|
|
"exec": [
|
|
""
|
|
]
|
|
}
|
|
}
|
|
]
|
|
} |