View Categories

REST API Integration for Agile Store Locator

The Agile Sync Addon allows you to synchronize store locations from virtually any REST API directly into Agile Store Locator. Instead of manually creating and updating store records, you can connect an external API, map its fields to Agile Store Locator fields, and automatically keep your store database synchronized.

This integration is ideal for businesses that maintain store data in external systems, custom applications, CRMs, inventory systems, government databases, or third-party platforms.

Supported Platforms #

The Agile Sync Addon currently supports synchronization from:

  • REST APIs
  • Google Sheets
  • SmartSheet
  • Salesforce

This guide focuses specifically on REST API integrations.


Benefits of REST API Integration #

REST API synchronization provides several advantages:

  • Automatically import store locations
  • Keep store data synchronized with external systems
  • Eliminate manual data entry
  • Update existing store records automatically
  • Import large location databases efficiently
  • Extend synchronization using developer hooks
  • Support custom authentication methods
  • Support JSON and CSV response formats

Creating a REST API Synchronization Job #

Navigate to:

WordPress Dashboard → Agile Store Locator → Agile Sync

Click:

Create New Job

This opens the Setup Connection screen.


Setup Connection #

The Setup Connection screen is used to configure how Agile Sync communicates with the external API.

API Title #

Enter a descriptive name for the synchronization job.

Example:

National Parks API

This title is only used internally to identify the synchronization job.


Platform #

Select the platform you want to connect.

Available options:

  • Google Sheets
  • SmartSheet
  • Salesforce
  • REST API

For this guide, select:

REST API


API Endpoint URL #

Enter the URL that returns your store data.

Example:

https://developer.nps.gov/api/v1/parks?limit=100&api_key=uiCREL5iS9wwGhksXyEogOEUtY0BeuXKyN1iFMFL

Agile Sync will retrieve data from this endpoint during synchronization.


HTTP Method #

Choose the HTTP method required by your API.

Common options include:

  • GET
  • POST
  • PUT
  • PATCH
  • DELETE

Most location APIs use:

GET

because they are only used to retrieve data.


Authentication Types #

Agile Sync supports multiple authentication methods.

None #

Use this option when the API is publicly accessible and requires no authentication.

Example:

Authentication Type: None

API Key #

Use API Key authentication when the API provider requires a key to access data.

API keys are commonly used by:

  • Google APIs
  • National Park Service APIs
  • Mapping services
  • Government APIs

The API key can usually be provided through URL parameters, headers, or request parameters.


Bearer Token #

Use Bearer Token authentication when the API requires an access token.

Example request header:

Authorization: Bearer YOUR_ACCESS_TOKEN

Bearer Tokens are commonly used for modern REST APIs and SaaS platforms.


OAuth 2.0 #

OAuth 2.0 is commonly required for:

  • Salesforce
  • Microsoft APIs
  • Enterprise APIs
  • Google Services

When OAuth 2.0 is selected, additional fields become available.

Client ID #

Enter the OAuth Client ID provided by the API provider.

Client Secret #

Enter the OAuth Client Secret.

Username #

Enter the username required for authentication.

Password #

Enter the corresponding password.

Token URL #

The Token URL is used to obtain and refresh OAuth access tokens.

Example:

https://login.salesforce.com/services/oauth2/token

Request Configuration #

Request Body (JSON) #

Some APIs require a JSON payload to be sent with the request.

Example:

{
  "country": "US",
  "status": "active"
}

This is most commonly used with POST requests.


Parameters (Key:Value) #

Additional request parameters can be passed as key-value pairs.

Example:

limit = 100
country = US
status = active

These values are automatically appended to the request.


Response Format #

Agile Sync currently supports:

  • JSON
  • CSV

JSON #

JSON is the recommended format for most integrations.

Example:

{
  "data": [
    {
      "id": "123",
      "name": "Store Name"
    }
  ]
}

CSV #

CSV can be used when the API returns comma-separated data.

Example:

id,name,city
1,Store A,New York
2,Store B,Chicago

Agile Sync automatically parses CSV data and makes the fields available during field mapping.


Starting Field Mapping #

Once the connection settings are configured, click:

Start Mapping

Agile Sync will connect to the API and retrieve the available fields.

These fields will appear in the mapping interface.


Mapping API Fields #

The Field Mapping screen allows you to connect API fields to Agile Store Locator store fields.

API Item ID #

This is the most important field in the mapping process.

The API Item ID must contain a unique value for each store.

This unique identifier is used to:

  • Prevent duplicate records
  • Match existing stores
  • Update stores during future synchronizations

Examples of suitable identifiers:

  • Store ID
  • Location ID
  • Branch ID
  • UUID
  • External System ID

Never use a field that may contain duplicate values.


Common Field Mappings #

Typical mappings include:

Store FieldExample API Field
API Item IDid
Titlename
Latitudelatitude
Longitudelongitude
Streetaddress
Citycity
Statestate
Postal CodepostalCode
Countrycountry
Emailemail
Phonephone
Websitewebsite
Descriptiondescription
Categoriescategory

Once the mapping is complete, click:

Save Mapping


Configuring Synchronization #

The final step is configuring how often Agile Sync should run.

Available frequencies include:

  • Hourly
  • Daily
  • Weekly

You can also:

  • Enable or disable the synchronization job
  • Receive email notifications
  • Automatically delete stores that no longer exist in the source API

Deletion Option #

When enabled, Agile Sync will remove store records that are no longer present in the API response.

Use this feature carefully, especially when synchronizing production data.


Running the Synchronization #

After the synchronization job is saved, Agile Sync begins importing locations.

Imported locations can be viewed under:

Agile Store Locator → Manage Stores

Depending on the size of the API response, synchronization may take several moments to complete.


Example REST API Integration #

The following National Park Service API can be used as a sample data source:

https://developer.nps.gov/api/v1/parks?limit=100&api_key=YOUR_API_KEY

This API provides:

  • Park Names
  • Coordinates
  • Addresses
  • Contact Information
  • Website URLs
  • Descriptions
  • Activities
  • Operating Hours

All of these fields can be synchronized directly into Agile Store Locator.


Advanced Custom Mapping with Developer Hooks #

Sometimes APIs contain information that does not directly match Agile Store Locator fields.

Examples include:

  • Operating Hours
  • Special Attributes
  • Multiple Categories
  • Business Metadata
  • Custom Labels

For these scenarios, Agile Sync provides developer hooks that allow you to modify data before it is saved.

Developer documentation:

https://agilestorelocator.com/wiki/agile-sync-addon-developer-hooks-actions


Importing Open Hours from an API #

Many APIs provide operating hours in a custom format.

Using the following filter:

add_filter(
    'asl_sync_data_row_mapping',
    'custom_mapping_function',
    10,
    2
);

developers can:

  • Access raw API data
  • Transform values
  • Populate Open Hours
  • Modify store information before saving

This allows operating hours to be imported automatically during synchronization.


Assigning Custom Markers Automatically #

Developer hooks can also be used to assign custom markers during synchronization.

Example:

$store_inst['marker_id'] = 151;

This automatically applies Marker ID 151 to every imported location.

No manual editing is required.


Recommended Configuration #

For most REST API integrations, use:

SettingRecommended Value
PlatformREST API
HTTP MethodGET
AuthenticationAPI Key or Bearer Token
Response FormatJSON
API Item IDUnique Identifier
FrequencyHourly or Daily

Conclusion #

The Agile Sync Addon makes it easy to connect Agile Store Locator with virtually any REST API. With support for multiple authentication methods, flexible field mapping, automatic synchronization schedules, JSON and CSV responses, and powerful developer hooks, you can maintain an accurate and up-to-date location database without manual updates.

Whether you’re importing a few locations or thousands of records, REST API integration provides a scalable and automated solution for managing store data in Agile Store Locator.

Video Tutorial #