Scheda dell'endpoint

POST /1.0/locations/resolve

Resolve missing location with AI

Locations POST

Endpoint

Scegli l'ambiente e l'indirizzo cambia con lui.

http://173.249.30.252/spedireweb/api/1.0/locations/resolve

Richiesta

Quelli segnati come necessari non si possono omettere.

3
Nome Dove Tipo Serve Descrizione
Authorization header string Sì Bearer access token. Example: Bearer <TOKEN>.
Accept header string Sì Expected response format.
Content-Type header string No Request body format when a JSON body is sent.
Authorization Serve
header string

Bearer access token. Example: Bearer <TOKEN>.

Accept Serve
header string

Expected response format.

Content-Type
header string

Request body format when a JSON body is sent.

Esempio richiesta

Metti il tuo token dove c'è scritto TOKEN.

cURL
curl -X POST "http://173.249.30.252/spedireweb/api/1.0/locations/resolve" \
     -H "Authorization: Bearer <TOKEN>" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -d '{\"query\":\"Wien 1010\",\"country\":\"AT\",\"save_if_verified\":true}'

Corpo richiesta

{
    "query": "Wien 1010",
    "country": "AT",
    "save_if_verified": true
}

Risposta

Un blocco per ogni risposta che l'endpoint può dare.

9

{
    "success": true
}

{
    "error": {
        "code": "REQUEST_1001",
        "message": "Invalid request."
    },
    "success": false,
    "request_id": "req_01k5example000000000000000"
}

{
    "error": {
        "code": "AUTH_1001",
        "message": "Authentication required."
    },
    "success": false,
    "request_id": "req_01k5example000000000000000"
}

{
    "error": {
        "code": "AUTH_1003",
        "message": "Permission denied."
    },
    "success": false,
    "request_id": "req_01k5example000000000000000"
}

{
    "error": {
        "code": "APP_1004",
        "message": "Resource not found."
    },
    "success": false,
    "request_id": "req_01k5example000000000000000"
}

{
    "error": {
        "code": "VALIDATION_1001",
        "message": "Location could not be resolved with sufficient confidence or city/postal code mismatch."
    },
    "success": false,
    "request_id": "req_01k5example000000000000000"
}

{
    "error": {
        "code": "RATE_LIMIT_1001",
        "message": "Too many requests."
    },
    "success": false,
    "request_id": "req_01k5example000000000000000"
}

{
    "error": {
        "code": "SERVER_1001",
        "message": "Internal server error."
    },
    "success": false,
    "request_id": "req_01k5example000000000000000"
}

{
    "error": {
        "code": "SERVICE_1001",
        "message": "No enabled AI provider is available."
    },
    "success": false,
    "request_id": "req_01k5example000000000000000"
}

Da sapere

Searches the local database first. If missing, uses the configured AI provider to resolve city, postal code, country, state and province; high-confidence matches can be saved without latitude/longitude. Requires locations.resolve. Requires a Bearer access token.