Request cURL JavaScript Python Java PHP C#
curl -X POST 'https://bemap.benomad.com/bgis/service/traffic/1.0' \
-u 'YOUR_ACCOUNT:YOUR_API_KEY' \
--fail-with-body \
-H 'Content-Type: application/json' \
-d '{
"boundingBox": {
"minLat": 48.8,
"minLon": 2.25,
"maxLat": 48.92,
"maxLon": 2.42
},
"countryCode": "FRA",
"outputLanguage": "fr",
"options": [
"POLYLINE"
]
}'const response = await fetch('https://bemap.benomad.com/bgis/service/traffic/1.0', {
method: 'POST',
headers: {
Authorization: 'Basic ' + btoa('YOUR_ACCOUNT:YOUR_API_KEY'),
'Content-Type': 'application/json',
},
body: JSON.stringify({
"boundingBox": {
"minLat": 48.8,
"minLon": 2.25,
"maxLat": 48.92,
"maxLon": 2.42
},
"countryCode": "FRA",
"outputLanguage": "fr",
"options": [
"POLYLINE"
]
}),
redirect: 'manual', // a missing credential answers 302: never follow it
});
if (response.type === 'opaqueredirect' || (response.status >= 300 && response.status < 400)) throw new Error('BeMap redirected to its login page: no credentials reached it');
if (!response.ok) throw new Error(`BeMap answered ${response.status}: ${await response.text()}`);
const data = await response.json();import requests
response = requests.post(
"https://bemap.benomad.com/bgis/service/traffic/1.0",
auth=("YOUR_ACCOUNT", "YOUR_API_KEY"),
json={
"boundingBox": {
"minLat": 48.8,
"minLon": 2.25,
"maxLat": 48.92,
"maxLon": 2.42,
},
"countryCode": "FRA",
"outputLanguage": "fr",
"options": ["POLYLINE"],
},
allow_redirects=False, # a missing credential answers 302: never follow it
)
if response.is_redirect:
raise RuntimeError("BeMap redirected to its login page: no credentials reached it")
if response.status_code != 200:
raise RuntimeError(f"BeMap answered {response.status_code}: {response.text}")
data = response.json()import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
String auth = Base64.getEncoder().encodeToString("YOUR_ACCOUNT:YOUR_API_KEY".getBytes(StandardCharsets.UTF_8));
String body = """
{
"boundingBox": {
"minLat": 48.8,
"minLon": 2.25,
"maxLat": 48.92,
"maxLon": 2.42
},
"countryCode": "FRA",
"outputLanguage": "fr",
"options": [
"POLYLINE"
]
}
""";
HttpRequest request = HttpRequest.newBuilder(URI.create("https://bemap.benomad.com/bgis/service/traffic/1.0"))
.header("Authorization", "Basic " + auth)
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
// HttpClient never follows redirects by default: a 302 means a missing credential.
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() / 100 == 3) throw new IllegalStateException("BeMap redirected to its login page: no credentials reached it");
if (response.statusCode() != 200) throw new IllegalStateException("BeMap answered " + response.statusCode() + ": " + response.body());
String json = response.body();<?php
$body = <<<'JSON'
{
"boundingBox": {
"minLat": 48.8,
"minLon": 2.25,
"maxLat": 48.92,
"maxLon": 2.42
},
"countryCode": "FRA",
"outputLanguage": "fr",
"options": [
"POLYLINE"
]
}
JSON;
$ch = curl_init('https://bemap.benomad.com/bgis/service/traffic/1.0');
curl_setopt_array($ch, [
CURLOPT_USERPWD => 'YOUR_ACCOUNT:YOUR_API_KEY',
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => $body,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => false, // a missing credential answers 302: never follow it
]);
$response = curl_exec($ch);
if ($response === false) throw new RuntimeException(curl_error($ch));
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($status >= 300 && $status < 400) throw new RuntimeException('BeMap redirected to its login page: no credentials reached it');
if ($status !== 200) throw new RuntimeException("BeMap answered $status: $response");
$data = json_decode($response, true);using System.Net;
using System.Net.Http.Headers;
using System.Text;
// AllowAutoRedirect = false: a missing credential answers 302, never follow it.
var client = new HttpClient(new HttpClientHandler { AllowAutoRedirect = false });
var token = Convert.ToBase64String(Encoding.UTF8.GetBytes("YOUR_ACCOUNT:YOUR_API_KEY"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", token);
var body = """
{
"boundingBox": {
"minLat": 48.8,
"minLon": 2.25,
"maxLat": 48.92,
"maxLon": 2.42
},
"countryCode": "FRA",
"outputLanguage": "fr",
"options": [
"POLYLINE"
]
}
""";
var response = await client.SendAsync(new HttpRequestMessage(HttpMethod.Post, "https://bemap.benomad.com/bgis/service/traffic/1.0")
{
Content = new StringContent(body, Encoding.UTF8, "application/json"),
});
if ((int)response.StatusCode / 100 == 3) throw new HttpRequestException("BeMap redirected to its login page: no credentials reached it");
if (response.StatusCode != HttpStatusCode.OK) throw new HttpRequestException($"BeMap answered {(int)response.StatusCode}: {await response.Content.ReadAsStringAsync()}");
var json = await response.Content.ReadAsStringAsync(); Build with AI
Help me integrate BeMap Traffic: Live traffic events and flow for an area.
Its operations, each with its reference:
- POST https://bemap.benomad.com/bgis/service/traffic/1.0 (Traffic): https://benomad.com/dev/doc/bemap-api/api/map-context/traffic.md
Authenticate with HTTP Basic (the BeMap account as the user name, the API key as the password) and do not follow redirects. BeMap ignores an unknown field name without an error: use only the fields the references list, and read what each value means there. Copy prompt Open in Claude Open in ChatGPT With the BeMap MCP server , your assistant also checks each request against the specification before sending it.