GPS WEBHOOK
Set up your GPS webhook receiver
Receive event-driven GPS plot updates from Verizon Connect through Amazon SNS.
Build a secure HTTPS endpoint and Reveal can send each new plot to your integration, without polling for updates.
Who this guide is for: developers who build and operate the receiving endpoint.
What you receive: a CloudEvents v1.0 message for every unique GPS plot, delivered through Amazon SNS.
How it works
Reveal sends GPS plots through Amazon SNS. Your endpoint receives a one-time subscription confirmation, then ongoing plot notifications.
Amazon SNS request headers and message types
Amazon SNS sends both message types to the same endpoint.
Requests include the User-Agent: Amazon Simple Notification Service Agent header.
Use the x-amz-sns-message-type header to identify each request; you don't need to parse the body to determine its type:
SubscriptionConfirmation: Activates the subscription during setup.Notification: Contains GPS plot data.
Prerequisites
Before building the receiver, ask your Verizon Connect account manager or admin to:
- Confirm GPS webhook access is enabled for your account.
- Agree on the Basic auth credentials (username and password) that Reveal will use to authenticate to your endpoint.
Then have your details ready to enter in Reveal:
- Your public endpoint URL.
- The integration username and password.
- And a contact who can submit the endpoint through the Reveal integration setup.
Endpoint requirements
The receiving endpoint must meet each requirement below for the SNS subscription to succeed.
| REQUIREMENT | DETAIL |
|---|---|
| Protocol | HTTPS only. Plain HTTP is not accepted. |
| TLS | TLS 1.2 or later, with a certificate from a trusted public CA. Certificate warnings are not allowed. |
| Port | 443. |
| Authentication | HTTP Basic (username + password). |
Accepted Content-Type | text/plain; charset=UTF-8 — required for both the subscription confirmation and the plot notifications. The body contains a JSON SNS envelope. |
| Public reachability | The endpoint must be publicly reachable from the internet. |
| Host name | Must not contain an underscore (_). |
| Credentials | Username/password must not contain escape sequences or special characters such as / \ ' " : @. Confirm the exact validation rules with the account administrator before choosing credentials. |
NOTE: Amazon SNS always sets the outer message content type header to text/plain; charset=UTF-8.
However, the message payload remains JSON. Refer to the datacontenttype field (application/json) in the CloudEvent envelope to determine how to parse the inner data object.
Set up your GPS webhook
- Set up a secure HTTPS endpoint to receive webhook payloads, validate incoming requests, and acknowledge delivery promptly.
Create a secure webhook endpoint
Route requests by thex-amz-sns-message-typeHTTP header; you do not need to inspect the body to distinguish the message types.SubscriptionConfirmationactivates the subscription.Notificationcarries GPS plots.
a) Handle the authentication challenge
The firstSubscriptionConfirmationrequest may arrive without anAuthorizationheader. Respond with401 Unauthorizedand aWWW-Authenticate: Basicheader.
Amazon SNS then retries the request with the Basic credentials configured for the integration.HTTP/1.1 401 Unauthorized WWW-Authenticate: Basic
b) Confirm the subscription once
After authentication, Amazon SNS sends aSubscriptionConfirmationmessage to your endpoint. To confirm the subscription, readSubscribeURLfrom the message body and send an HTTPGETrequest to that URL. Amazon SNS returns an XMLConfirmSubscriptionResponsewhen the confirmation succeeds.POST / HTTP/1.1 x-amz-sns-message-type: SubscriptionConfirmation x-amz-sns-message-id: 165545c9-2a5c-472c-8df2-7ff2be2b3b1b x-amz-sns-topic-arn: arn:aws:sns:us-west-2:123456789012:MyTopic Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== Content-Length: 1336 Content-Type: text/plain; charset=UTF-8 Host: myhost.example.com Connection: Keep-Alive User-Agent: Amazon Simple Notification Service Agent { "Type": "SubscriptionConfirmation", "MessageId": "165545c9-2a5c-472c-8df2-7ff2be2b3b1b", "Token": "2336412f37...", "TopicArn": "arn:aws:sns:us-west-2:123456789012:MyTopic", "Message": "You have chosen to subscribe to the topic arn:aws:sns:us-west-2:123456789012:MyTopic.\nTo confirm the subscription, visit the SubscribeURL included in this message.", "SubscribeURL": "https://sns.us-west-2.amazonaws.com/?Action=ConfirmSubscription&TopicArn=arn:aws:sns:us-west-2:123456789012:MyTopic&Token=2336412f37...", "Timestamp": "2012-04-26T20:45:04.751Z", "SignatureVersion": "1", "Signature": "EXAMPLEpH+DcEwjAPg8O9mY8dReBSwksfg2S7WKQcikcNKWLQjwu6A4VbeS0QHVCkhRS7fUQvi2egU3N858fiTDN6bkkOxYDVrY0Ad8L10Hs3zH81mtnPk5uvvolIC1CXGu43obcgFxeL3khZl8IKvO61GWB6jI9b5+gLPoBc1Q=", "SigningCertURL": "https://sns.us-west-2.amazonaws.com/SimpleNotificationService-f3ecfb7224c7233fe7bb5f59f96de52f.pem" }
Plot delivery starts after confirmation: No GPS plot notifications are sent until the subscription is confirmed. You only need to confirm it again if the endpoint URL or credentials change in Reveal.
c) Receive and acknowledge plot notifications
After confirmation, SNS sendsNotificationmessages to the same endpoint. Parse each JSON body as a CloudEvent and read the GPS plot fromdata.
Validate the notification, place it on a queue, and return200 OKwithin 15 seconds. Process the plot asynchronously after acknowledging delivery.
Whendata.isPrivateistrue, the payload does not include the address, latitude, longitude, or speed.
Response-code rule needs confirmation: Return200 OKto acknowledge delivery. Other 2xx status codes are not confirmed; check with the webhook owner before relying on them.
See Receive and acknowledge plot events for response and privacy requirements.
Also see the payload reference and code samples.POST / HTTP/1.1 x-amz-sns-message-type: Notification x-amz-sns-message-id: 22b80b92-fdea-4c2c-8f9d-bdfb0c7bf324 x-amz-sns-subscription-arn: arn:aws:sns:us-west-2:123456789012:MyTopic:c9135db0-26c4-47ec-8998-413945fb5a96 Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== Content-Type: text/plain; charset=UTF-8 Host: myhost.example.com User-Agent: Amazon Simple Notification Service Agent - Verify the endpoint is publicly reachable, then confirm it receives and processes plots after the subscription is active.
Test and monitor webhook deliveries
- Verify reachability before you subscribe (see the FAQ for the
cURLcheck against an API). - Make processing idempotent because retries can deliver the same plot more than once. De-duplicate using:
- the SNS
x-amz-sns-message-idheader, and/or - the payload
data.sequenceId; the sequence ID can also help order plots and detect gaps.
- the SNS
- Log and alert on failed responses (non-
200responses, processing exceptions) so you can investigate missed events. - Allow 5–15 minutes for the first plots to arrive after confirmation.
- Verify reachability before you subscribe (see the FAQ for the
- Once the endpoint is built and tested, share its URL and credentials with your Reveal administrator or account manager.
Submit your endpoint
Ask them to submit the endpoint and credentials through the Reveal Marketplace. Submitting these in Reveal starts the subscription-confirmation process described in Step 1.
GPS plot payload reference
SNS sends a JSON envelope with CloudEvents 1.0 fields. The GPS plot is nested under data.
The HTTP request content type is text/plain; charset=UTF-8; the envelope's datacontenttype describes the inner data as application/json.
{
"specversion": "1.0",
"id": "813af552-c049-43d9-b978-159a1857f43e",
"type": "com.verizonconnect.integrations.vehicle.position.updated",
"source": "https://verizonconnect.com/integrations/channels/push",
"time": "2022-10-05T09:45:30.3799855Z",
"subject": "vehicle.esn.342434234",
"datacontenttype": "application/json",
"traceparent": "00-14807e2fb520d20f5f779b6dc7b24edf-8183903ec4aa3410-00",
"data": {
"sequenceId": 999000000,
"updateUTC": "2022-10-21T13:34:39",
"deviceTimeZoneOffset": 2,
"deviceTimeZoneUseDST": true,
"displayState": "Idle",
"isPrivate": false,
"speedKmph": 85,
"directionDegrees": 280,
"heading": "North",
"deltaDistanceKm": 0.354,
"odometerKm": 120045,
"totalEngineMinutes": 1380,
"idleTimeMinutes": 4,
"latitude": -6.3752626,
"longitude": 53.2979679,
"deltaTimeInSec": 90,
"sensorBits": 65,
"sensorValues": ["Boom Stow 1-ON", "Boom Stow 2-OFF", "Boom Stow 3-OFF", "Boom Stow 4-OFF"],
"vehicle": {
"number": "V242342",
"name": "Truck2324",
"vin": "Z232SD43FAS",
"esn": 342434234
},
"address": {
"addressLine1": "Atrium Building, Blackthorn Road",
"addressLine2": "Sandyford Business Park",
"locality": "Dublin",
"postalCode": "D18 F5X2",
"administrativeArea": "Dublin",
"country": "IRL"
},
"driver": {
"driverKeyFobId": 234423678,
"driverNumber": "D234",
"driverFirstName": "Tim",
"driverLastName": "Daruch"
}
}
}
CloudEvent envelope
| FIELD | DESCRIPTION |
|---|---|
specversion | CloudEvents spec version (1.0). |
id | Unique event ID. |
type | com.verizonconnect.integrations.vehicle.position.updated |
source | Event source (URI), for example https://verizonconnect.com/integrations/channels/push. |
time | Event time (UTC, RFC 3339). |
subject | Event subject, e.g. vehicle.esn.342434234. |
datacontenttype | Content type of the data member — application/json. |
traceparent | W3C trace context for correlation/observability. |
data | The GPS plot (fields below). |
GPS plot fields in data
| FIELD | NOTES AND DEFAULT VALUES |
|---|---|
vehicle.number | The Vehicle Number as configured in Reveal. |
vehicle.name | The Vehicle Name as displayed in the Reveal account. |
vehicle.vin | The VIN as displayed in the Reveal account. |
vehicle.esn | Uniquely identifies a vehicle. Mandatory for vehicle creation in Reveal. |
sequenceId | Sequence identifier for individual plots. Use it to order plots and detect duplicates during retries. |
updateUTC | Timestamp (UTC) when the GPS plot was received. Format YYYY-MM-DDThh:mm:ss. |
deviceTimeZoneOffset | The GPS device's current time zone offset from UTC. |
deviceTimeZoneUseDST | true if the Reveal account acknowledges Daylight Saving Time. US accounts default to true. |
displayState | Vehicle display state: 0 Coverage, 1 Moving, 2 Stop, 3 Towing, 4 Idle, 5 Panic, 6 Privacy. |
isPrivate | true when the Privacy feature hides location during non-business hours. When true, address, coordinates, and speed are not returned. |
speedKmph | Speed in kilometers per hour. |
directionDegrees | Compass direction, in degrees. |
heading | North, North East, East, South East, South, South West, West, North West, Unknown. |
deltaDistanceKm | Distance accumulated since the previous plot. Defaults to 0 if none accumulated. |
odometerKm | Odometer is the vehicle's current odometer reading, in kilometers, at the requested UTC timestamp. |
totalEngineMinutes | Engine minutes accumulated across the device lifetime during Ignition-On plots. |
idleTimeMinutes | Continuous idling time, in minutes. |
deltaTimeInSec | Time between the previous plot and this plot. Defaults to NULL if none accumulated. |
address | Global address components: addressLine1 (e.g. house number), addressLine2 (e.g. apartment), locality (city/town), administrativeArea (state/province), postalCode, country. |
latitude | Latitude coordinate of the plot. |
longitude | Longitude coordinate of the plot. |
driver.driverKeyFobId | Hexadecimal value of the driver's current key fob, supplied in Reveal. |
driver.driverNumber | Unique driver identifier in Reveal. NULL if no driver assigned, or the assigned driver has no number. |
driver.driverFirstName | Driver's first name in Reveal. NULL if no driver assignment for this plot. |
driver.driverLastName | Driver's last name in Reveal. NULL if no driver assignment for this plot. |
sensorBits | Combined decimal value of all sensor flags. |
sensorValues | Names of sensors that are active (ON) for this plot. |
Delivery and retry behavior
Build your receiver to tolerate duplicate deliveries. A failed acknowledgement can cause the same message to be retried.
| BEHAVIOR | WHAT TO EXPECT |
|---|---|
Success response | Only HTTP 200 OK is confirmed as a successful response. Check with the webhook owner whether other 2xx status codes are accepted. |
Response deadline | Must respond within ~15 seconds, or the delivery is considered failed. |
Retries | After a failed delivery, the service retries the same message up to 2 times, at 60-second intervals. If delivery still fails, the message is discarded. |
Duplicate handling | Use x-amz-sns-message-id and/or data.sequenceId to detect duplicate deliveries. Use sequenceId to order plots and detect gaps. |
First plot | Allow 5–15 minutes after subscription confirmation for the first plots to arrive. |
Keep the request path short
Validate and enqueue the event synchronously, acknowledge it, then do downstream processing asynchronously. Log and alert on non-200 responses and processing exceptions so your team can investigate missed events.
FAQ and troubleshooting
Not receiving the subscription confirmation message
- Confirm that the endpoint is publicly reachable over HTTPS on port
443, uses TLS 1.2 or later with a trusted certificate, and accepts requests withContent-Type: text/plain; charset=UTF-8. The host name must not contain an underscore, and the credentials must meet the restrictions listed under Endpoint requirements.
From any machine or REST client (e.g. Postman), send a test POST:curl -X POST your_HTTPS_endpoint -H "Content-Type: text/plain; charset=UTF-8" --data '{"x":"y"}' -v- From outside your network, send the approved test POST request to the endpoint and confirm that it returns
200 OK. - If SNS cannot reach the endpoint, subscription setup may fail with an
InvalidParameter: Unreachable Endpointerror. - Your host name must not contain an underscore, and the username/password must not contain escape sequences or special characters such as
/ \ ' " : @.
- From outside your network, send the approved test POST request to the endpoint and confirm that it returns
- Confirm that your endpoint routes requests using the
x-amz-sns-message-typeheader, and handles bothSubscriptionConfirmationandNotificationmessages. Example of confirmation header:POST / HTTP/1.1 x-amz-sns-message-type: SubscriptionConfirmation x-amz-sns-message-id: 165545c9-2a5c-472c-8df2-7ff2be2b3b1b x-amz-sns-topic-arn: arn:aws:sns:us-west-2:123456789012:MyTopic Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== Content-Type: text/plain; charset=UTF-8 Host: your_host_name User-Agent: Amazon Simple Notification Service Agent - The initial
SubscriptionConfirmationrequest may arrive without anAuthorizationheader. In that case, respond with401 Unauthorizedand aWWW-Authenticate: Basicheader (per RFC 7617 / RFC 2617):WWW-Authenticate: Basic
Will this 401 happen for every plot?
Confirm with your webhook owner whether Amazon SNS includes Basic credentials with every notification. Do not assume the 401 challenge happens only during setup.
Why is Content-Type text/plain when the sample shows application/json?
text/plain; charset=UTF-8 is the HTTP content type Amazon SNS uses for the request body, which contains a JSON envelope.
Inside that envelope, datacontenttype: application/json describes the data member.
Accept the SNS request as text/plain, parse its body as JSON, then process data as JSON.
How do I handle duplicates and ordering?
During temporary failures, SNS may retry a delivery, so the same plot can arrive more than once.
- Process notifications idempotently.
- Use
data.sequenceIdto order plots, detect duplicates, and identify gaps. - Use the
x-amz-sns-message-idheader to identify duplicate SNS deliveries.
Code samples
Reference only — adapt to your framework and replace the hard-coded credential check with a constant-time comparison against securely stored secrets.
Authentication middleware (Basic → 401 + WWW-Authenticate)
public async Task Invoke(HttpContext context)
{
var authHeader = context.Request.Headers.Get("Authorization");
if (authHeader != null && authHeader.StartsWith("basic", StringComparison.OrdinalIgnoreCase))
{
var token = authHeader.Substring("Basic ".Length).Trim();
var credentialString = Encoding.UTF8.GetString(Convert.FromBase64String(token));
var credentials = credentialString.Split(':');
if (credentials[0] == "admin" && credentials[1] == "password")
{
var claims = new[] { new Claim("name", credentials[0]), new Claim(ClaimTypes.Role, "Admin") };
var identity = new ClaimsIdentity(claims, "Basic");
context.User = new ClaimsPrincipal(identity);
}
}
else
{
context.Response.StatusCode = 401;
context.Response.Headers.Set("WWW-Authenticate", "Basic");
}
await _next(context);
}
Process the SNS message (confirmation + notification)
[HttpPost]
[Consumes(MediaTypeNames.Text.Plain)]
public async Task<IActionResult> ProcessRequest()
{
var options = new JsonSerializerOptions { PropertyNameCaseInsensitive = true };
try
{
string requestMessage;
using (var reader = new StreamReader(Request.Body, Encoding.UTF8))
{
requestMessage = await reader.ReadToEndAsync();
}
switch (Request.Headers["x-amz-sns-message-type"])
{
case "SubscriptionConfirmation":
var snsMessage = JsonSerializer.Deserialize<SnsMessageModel>(requestMessage);
bool hasConfirmed = await ConfirmSubscription(snsMessage.SubscribeURL);
// retry or process further if needed
break;
case "Notification":
var cloudEvent = JsonSerializer.Deserialize<VzcCloudEvent>(requestMessage, options);
await ProcessVzcGpsMessage(cloudEvent.Data);
break;
default:
// handle your default
break;
}
return Ok();
}
catch (Exception ex)
{
_logger.LogError(ex, "Processing webhook request failed");
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
}
}
private async Task<bool> ConfirmSubscription(string subscriptionUrl)
{
using var httpClient = new HttpClient();
var response = await httpClient.SendAsync(
new HttpRequestMessage(HttpMethod.Get, new Uri(subscriptionUrl)));
return response.IsSuccessStatusCode;
}
private Task ProcessVzcGpsMessage(GpsPlotMessage gpsData)
{
// Process GPS data
return Task.CompletedTask;
}
Sample models
public class VzcCloudEvent
{
public string Type { get; set; }
public string SpecVersion { get; set; }
public string Source { get; set; }
public string Subject { get; set; }
public DateTime Time { get; set; }
public GpsPlotMessage Data { get; set; }
}
public class GpsPlotMessage
{
public int SequenceId { get; set; }
public VehicleInfo Vehicle { get; set; }
public DateTime UpdateUTC { get; set; }
public float DeviceTimeZoneOffset { get; set; }
public string DisplayState { get; set; }
public bool IsPrivate { get; set; }
public float SpeedKmph { get; set; }
public int DirectionDegrees { get; set; }
public string Heading { get; set; }
public float DeltaDistanceKm { get; set; }
public double OdometerKm { get; set; }
public int TotalEngineMinutes { get; set; }
public int IdleTimeMinutes { get; set; }
public AddressInfo Address { get; set; }
public double? Latitude { get; set; }
public double? Longitude { get; set; }
public DriverInfo Driver { get; set; }
public float DeltaTimeInSec { get; set; }
public int SensorBits { get; set; }
public string[] SensorValues { get; set; }
}
public class VehicleInfo
{
public string Number { get; set; }
public string Name { get; set; }
public string VIN { get; set; }
public long? ESN { get; set; }
}
public class AddressInfo
{
public string AddressLine1 { get; set; }
public string AddressLine2 { get; set; }
public string Locality { get; set; }
public string PostalCode { get; set; }
public string AdministrativeArea { get; set; }
public string Country { get; set; }
}
public class DriverInfo
{
public object DriverKeyFobId { get; set; }
public string DriverLastName { get; set; }
public string DriverFirstName { get; set; }
public string DriverNumber { get; set; }
}
AWS API Gateway
If AWS API Gateway sits in front of your endpoint, configure it to respond to the initial request without an Authorization header with 401 Unauthorized and a WWW-Authenticate: Basic header. See Step 1a for details.