Login de usuario
Login de usuario
POST https://api.test.fandit.es/api/v2/users/login/
Petición para obtener los token de usuario y experto si es el caso.
Parámetros de consulta (body)
Respuesta
Object
token string
ExpertToken string
user Object
id number
email string
username string
first_name string
last_name string
platform number
is_active boolean
communities_list array of numbers
provinces_list array of numbers
applicants_list array of numbers
region_types_list array of numbers
actions_list array of numbers
activities_list array of numbers
general_notifications boolean
distributor string
business_name string
phone string
fund_types_list array of numbers
origins_list array of numbers
curl--request POST \--url 'https://api.test.fandit.es/api/v2/users/login/' \--header 'Content-Type: application/json' import requests
url = "https://api.test.fandit.es/api/v2/users/login/"
headers = {
"Content-Type": "application/json"
}
response = requests.post(url, headers=headers)
print(response.status_code)
print(response.json())
const url = "https://api.test.fandit.es/api/v2/users/login/";
const options = {
method: "POST",
headers: {
"Content-Type": "application/json"
}
};
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
const url: string = "https://api.test.fandit.es/api/v2/users/login/";
const options: RequestInit = {
method: "POST",
headers: {
"Content-Type": "application/json"
}
};
const response = await fetch(url, options);
const data: any = await response.json();
console.log(data);
<?php
$url = "https://api.test.fandit.es/api/v2/users/login/";
$curl = curl_init($url);
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
]
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import java.io.IOException;
import okhttp3.*;
public class FanditApiExample {
public static void main(String[] args) throws IOException {
OkHttpClient client = new OkHttpClient();
String url = "https://api.test.fandit.es/api/v2/users/login/";
Request request = new Request.Builder()
.url(url)
.addHeader("Content-Type", "application/json")
.post()
.build();
try (Response response = client.newCall(request).execute()) {
System.out.println(response.body().string());
}
}
}
Respuesta Ejemplo de respuesta
{
"token": "9a1c3f5e7b2d4a6c8e0f1b3d5a7c9e1f3b5d7a9c",
"ExpertToken": "b3e1a2c4d5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0",
"user": {
"id": 10482,
"email": "laura.gomez@empresa.es",
"username": "laura.gomez",
"first_name": "Laura",
"last_name": "Gómez",
"platform": 3,
"is_active": true,
"communities_list": [
1,
8
],
"provinces_list": [
28,
41
],
"applicants_list": [
2,
5
],
"region_types_list": [
1
],
"actions_list": [
3,
7,
12
],
"activities_list": [
15,
22
],
"general_notifications": true,
"distributor": "FANDIT",
"business_name": "Innovatech Soluciones S.L.",
"phone": "+34600123456",
"fund_types_list": [
1,
4
],
"origins_list": [
2
]
}
}