Skip to content

Obtain a site access token

Request

Authenticate using client credentials to obtain a Bearer token scoped to a site. This endpoint is shared between V1 and V2. The token must be included in the Authorization: Bearer {token} header for all subsequent requests.

Authentication:

Pass your credentials in the Authorization header using HTTP Basic Auth: Basic base64(client_id:client_secret).

Request body:

You must provide either site_id or manufacturer_id to scope the token.

Multi-Agency Scoping:

Authentication is linked to a Site. A Site groups one or more agencies (manufacturers). Your token grants access to all agencies in the Site's manufacturers_list.

  • The agency_id field in requests must reference an agency within that scope.
  • Use GET /agencies to list accessible agencies for your token.

Multi-site scenarios:

  • Option A: One Site grouping all agencies (single credential, single site_id).
  • Option B: Multiple credentials (one per Site), each accessing a subset of agencies. You obtain a separate token for each site_id.

Example (curl):

curl -X POST 'https://v2.immo-facile.com/api/client/token/site' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Authorization: Basic base64(client_id:client_secret)' \
  --data-urlencode 'site_id=12345'
Security
basicAuth
Bodyapplication/x-www-form-urlencodedrequired
One of:
site_idintegerrequired

Numeric site ID to scope the token to.

Example:12345
curl -i -X POST \
  -u '<username>:<password>' \
  https://api-doc.immo-facile.com/_mock/openapi/api/client/token/site \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d site_id=12345

Responses

Token issued successfully

Bodyapplication/json
domainstring, (uri)

Base domain to use for all subsequent API calls. The API base URL is not fixed: use this value as the base ({domain}/api/v2/site/...). In the Try it console, paste it into the domain server variable.

Example:"https://v2.immo-facile.com"
token_typestring
Value:"Bearer"
expires_ininteger

Token lifetime in seconds

Example:604800
access_tokenstring

Bearer token to use in the Authorization header for all subsequent API calls.

refresh_tokenstring

Token used to obtain a new access token once the current one expires.

Response
{ "domain": "https://v2.immo-facile.com", "token_type": "Bearer", "expires_in": 604800, "access_token": "string", "refresh_token": "string" }