Name API — Validación de nombre de pila

Support DQE
Support DQE
  • Actualización
Name API - Sugerir nombres de pila

Utilice este endpoint para sugerir nombres de pila basados en la entrada del usuario.

Documentación relacionada de Name - Para una visión general del servicio, consulte Name API — Introducción →
Para sugerencias de apellidos, consulte Name API — Validación de apellido →

/FIRSTNAMESUGGEST/

Solicitud

Se admiten tanto GET como POST.

{SERVER_ADDRESS} y {LICENCE_CODE} son proporcionados por DQE al crear la cuenta. Póngase en contacto con su gestor de cuenta de DQE para obtenerlos.
GEThttps://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/?Firstname={FIRST_NAME}&Gender={GENDER}&NBResponse={NUM}&Licence={LICENCE_CODE}&Country={COUNTRY_CODE}&Format={FORMAT}&Verifname=Y

Ejemplos de código

Sugerencia de nombre de pila

curl "https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/?Firstname=Ali&Gender=F&NBResponse=10&Country=FRA&Format=0&Licence={LICENCE_CODE}"
fetch("https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/?" + new URLSearchParams({ Firstname: "Ali", Gender: "F", NBResponse: "10", Country: "FRA", Format: "0", Licence: "{LICENCE_CODE}" })) .then(r => r.json()) .then(data => console.log(data));
import requests response = requests.get( "https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/", params={ "Firstname": "Ali", "Gender": "F", "NBResponse": "10", "Country": "FRA", "Format": "0", "Licence": "{LICENCE_CODE}", }, ) print(response.json())
<?php $params = http_build_query([ 'Firstname' => 'Ali', 'Gender' => 'F', 'NBResponse' => '10', 'Country' => 'FRA', 'Format' => '0', 'Licence' => '{LICENCE_CODE}', ]); $ch = curl_init("https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/?{$params}"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $data = json_decode($response, true);
const axios = require('axios'); axios.get('https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/', { params: { Firstname: 'Ali', Gender: 'F', NBResponse: '10', Country: 'FRA', Format: '0', Licence: '{LICENCE_CODE}' } }) .then(response => console.log(response.data));
HttpClient client = HttpClient.newHttpClient(); String url = "https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/" + "?Firstname=Ali&Gender=F&NBResponse=10&Country=FRA&Format=0&Licence={LICENCE_CODE}"; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(url)) .GET() .build(); HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body());
using var client = new HttpClient(); var url = "https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/" + "?Firstname=Ali&Gender=F&NBResponse=10&Country=FRA&Format=0&Licence={LICENCE_CODE}"; var response = await client.GetAsync(url); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);
package main import ( "fmt" "io" "net/http" ) func main() { url := "https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/" + "?Firstname=Ali&Gender=F&NBResponse=10&Country=FRA&Format=0&Licence={LICENCE_CODE}" resp, err := http.Get(url) if err != nil { panic(err) } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body)) }
POSThttps://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/

Envíe todos los parámetros en el cuerpo de la solicitud usando Content-Type: application/x-www-form-urlencoded. La dirección del servidor permanece en la URL.

Ejemplos de código

Sugerencia de nombre de pila

curl -X POST "https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "Licence={LICENCE_CODE}" \ -d "Firstname=Ali" \ -d "Gender=F" \ -d "NBResponse=10" \ -d "Country=FRA" \ -d "Format=0"
fetch("https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/", { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: new URLSearchParams({ Licence: "{LICENCE_CODE}", Firstname: "Ali", Gender: "F", NBResponse: "10", Country: "FRA", Format: "0" }) }) .then(r => r.json()) .then(data => console.log(data));
import requests response = requests.post( "https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/", data={ "Licence": "{LICENCE_CODE}", "Firstname": "Ali", "Gender": "F", "NBResponse": "10", "Country": "FRA", "Format": "0", }, ) print(response.json())
<?php $ch = curl_init("https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/"); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([ 'Licence' => '{LICENCE_CODE}', 'Firstname' => 'Ali', 'Gender' => 'F', 'NBResponse' => '10', 'Country' => 'FRA', 'Format' => '0', ])); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $data = json_decode($response, true);
const axios = require('axios'); const qs = require('querystring'); axios.post('https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/', qs.stringify({ Licence: '{LICENCE_CODE}', Firstname: 'Ali', Gender: 'F', NBResponse: '10', Country: 'FRA', Format: '0' })) .then(response => console.log(response.data));
HttpClient client = HttpClient.newHttpClient(); String form = "Licence={LICENCE_CODE}&Firstname=Ali&Gender=F&NBResponse=10&Country=FRA&Format=0"; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/")) .header("Content-Type", "application/x-www-form-urlencoded") .POST(HttpRequest.BodyPublishers.ofString(form)) .build(); HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body());
using var client = new HttpClient(); var form = new Dictionary<string, string> { ["Licence"] = "{LICENCE_CODE}", ["Firstname"] = "Ali", ["Gender"] = "F", ["NBResponse"] = "10", ["Country"] = "FRA", ["Format"] = "0" }; var response = await client.PostAsync( "https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/", new FormUrlEncodedContent(form)); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);
package main import ( "fmt" "io" "net/http" "net/url" ) func main() { form := url.Values{} form.Set("Licence", "{LICENCE_CODE}") form.Set("Firstname", "Ali") form.Set("Gender", "F") form.Set("NBResponse", "10") form.Set("Country", "FRA") form.Set("Format", "0") resp, err := http.PostForm("https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/", form) if err != nil { panic(err) } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body)) }

Parámetros

Parámetro Descripción Obl. / Opc.
Licence Código de licencia asignado a su cuenta. Obligatorio
Firstname Parte del nombre de pila ya introducida por el usuario. Obligatorio
Gender M, F, o I. Opcional
NBResponse Número máximo de sugerencias a devolver. Predeterminado: 10. Opcional
Country Código de país ISO de 3 letras utilizado para priorizar las sugerencias. Opcional
Format Formato de salida deseado. Predeterminado: 0. Opcional
Verifname Comprueba si el nombre de pila existe sin autocompletar (indicar Y). Opcional

Valores de Format

Format Descripción
0 Nombre de pila en mayúsculas sin acentos.
1 Primera letra en mayúscula sin acentos.
2 Nombre de pila en minúsculas sin acentos.
3 Nombre de pila en mayúsculas con acentos.
4 Primera letra en mayúscula con acentos.
5 Nombre de pila en minúsculas con acentos.

Respuesta

La respuesta JSON es un diccionario que contiene la clave suggest. Su valor es un array de elementos sugeridos. Cada elemento es un array de dos cadenas: el primer valor es el género del nombre de pila (M, F, o I), y el segundo valor es el nombre de pila sugerido.

Clave Valores posibles Descripción Tipo
suggest[X][0] F, M, I Género del nombre de pila sugerido — F: femenino, M: masculino, I: desconocido. STRING(1)
suggest[X][1] — Nombre de pila sugerido. STRING(255)

Ejemplo de respuesta

{
  "suggest": [
    ["F", "ALICE"],
    ["F", "ALICE-ANNE"],
    ["F", "ALICE-MARIE"]
  ]
}

Errores

Tipo de error Ejemplo de solicitud Cuerpo de la respuesta
Parámetro Licence faltante, vacío o incorrecto https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/?Firstname=Ali&Gender=F&NBResponse=10
{}
Parámetro Firstname faltante o vacío https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/?Gender=F&NBResponse=10&Licence={LICENCE_CODE}
{"suggest": []}
Error tipográfico en el parámetro https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/?Firtname=Ali&Gender=F&NBResponse=10&Licence={LICENCE_CODE}
{"suggest": []}

Probar la API

Haga clic en el botón de abajo para probar este endpoint en vivo desde su navegador.

Abrir consola

Véase también

Relacionada con

¿Fue útil este artículo?

Usuarios a los que les pareció útil: 0 de 0