Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Dealers API handler

Return a collection of dealers.

HTTP Verb – GET

URL – /api/v1/dealers

Description – Returns a collection of dealers

BaseHandlerBase\<GetDealerCollectionParameter, GetDealerCollectionResult>

Handlers

OrderHandlerDescription
500GetDealerCollectionHandlerGets a collection of the dealers.
OrderHandlerDescription
500GetCoordinatesSets Latitude, Longitude and Radius properties in the result object.
600GetDealersCountRetrieves dealers count using DealerRepository. The dealers count is stored in the TotalCount property in the result object.
700GetDealersIf DealerId parameter has a value, retrieves a dealers by DealersId parameter. Otherwise retrieves a dealers using DealerRepository by coordinates. The dealers are stored in the DealerDtos property in the result object.
800CreateGetDealerResultsRetrieves HtmlContent for each dealer. Copy custom properties to each dealer object. Create GetDealerResults from DealerDtos and stored it in the GetDealerResults property in the result object. Also find DistanceUnitOfMeasure and stored it in the DistanceUnitOfMeasure property in the result object.

HTTP Verb – GET

URL – /api/v1/dealers/{dealerId}

Description – Returns a single dealer record

BaseHandlerBase\<GetDealerParameter, GetDealerResult>

Handlers

OrderHandlerDescription
500GetDealerHandlerGets a dealer for the matching dealerId, if an exception occurs a General Failure error result is returned.
OrderHandlerDescription
500GetDealerRetrieves a dealer by DealerId parameter using GetDealerCollectionHandler handler chain. The dealer is stored in the Dealer property in the result object.

HTTP Verb – GET

URL – /api/v1/dealers/getByPath

Description – Get a dealer by its URL path

BaseHandlerBase\<GetDealerByPathParameter, GetDealerByPathResult\>

Handlers

OrderHandlerDescription
500GetDealerByPathRetrieves dealer details page URLs from cache (5-minute expiration) grouped by language. Extracts the dealer URL segment from the decoded path. Looks up the dealer by URL segment in the DealerRepository. Returns NotFound error if the dealer is not found. Populates the result with the dealer and its detail page path, including alternate language URLs.

HTTP Verb – N/A (internal service call for Spire CMS page rendering)

Description – Get a dealer details page with dealer data for rendering

BaseHandlerBase\<GetDealerPageParameter, GetDealerPageResult\>

Handlers

OrderHandlerDescription
100ValidateContextRetrieves the DealerDetailsPage from the content system. Returns error if the page is not found or not of type "DealerDetailsPage". Resolves the dealer details page URL for the current language. Handles language switching by parsing the URL segment from the previous language URL.
200GetDealerCalls DealerService.GetDealerByPath with the resolved path. Returns NotFound error if the path is blank or the dealer is not found.
300CreateDealerPageValidates both the dealer details page and dealer exist. Sets alternate language URLs and the canonical URL on the page result using the dealer's language-specific URLs.