Enabling Address Search Using Address Services
Overview
Address Services enables address-location searching using the Address Search component. enter a location's address, and results narrow as they type. Sometimes, your end-users may know the name of the location, but not the address. Address Services let your end-users look up a location instead. These services also let them search for the name of a business, building, or landmark.
The benefits of using the address service for the Address Search component include:
-
Security: (application programming interface) keys are stored server-side and not exposed to end-users.
-
Performance: API service requests execute server-side, making them perform better.
-
Maintainability: Acts as a central place to maintain address API services, making it easier to change them.
When setting up a new service, it is the customer/creator's responsibility to obtain an API key for the Google Places or Canada Post services. API Keys are owned by the customer and should not be exposed to end-users.
What You’ll Learn
In this article, we'll cover how to set up each of the address services for address look-up with the Address Search component.
Setting Up a Google Places Service in Service Administration
The first step in using Google Places address look-up is adding the Google Place Details API service. You'll do this in Services Administration. You must have a Google Places API key to set up a Google Place Details Service.
To learn more about getting a Google Places API key, visit the following link: https://developers.google.com/places/web-service/get-api-key.
|
1.
|
At the top right of the Unqork Designer Platform, click the drop-down. |
|
3.
|
Under Integration, select Services Administration to open the Services Administration page. |
|
4.
|
Click + Add a Service. |
|
5.
|
In the Service Title field, enter {teamName} - Google Places. Replace {teamName} with your initials or the name of your application team. For example: Sales - Google Places. |
|
6.
|
In the Service Name field, enter {teamName}-google-places. |
Use lowercase alphanumeric characters along with a hyphen (-). A Service Name cannot not start or end with a hyphen. There cannot be consecutive hyphens in a Service Name.
|
7.
|
Click Create. The service's information page displays. |
|
8.
|
Click Edit. |
|
10.
|
From the Authentication method drop-down, select Google Places. |
|
11.
|
Enter the Google Places API key. |
|
12.
|
Click Save Changes. The Services Administration page loads, displaying the new service at the top of the list. |
Configuring an Address Search Component to Use the Google Place Details Service
Configure an Address Search component to use the Google Place Details service. These instructions assume that you have an open module saved with a title.
|
1.
|
Drag and drop an Address Search component onto your canvas. |
|
2.
|
In the field, enter address. |
|
3.
|
In the field, enter Enter Your Address:. |
|
4.
|
Check any of the Show Street, Show Street 2, Show City, Show State, Show Zip, and Show Country checkboxes as desired. Checked fields display in Express View and populate with the data returned by the Google Places API. |
All location data returned by the Google Places API stores in the submission data, even if you don't check the respective checkbox.
|
5.
|
From the component's configuration window, select the Data tab. |
|
6.
|
From the Select API drop-down, select the Address Service created in the previous section. In this case, Sales - Google Places. This connects your Address Search component to the Google Places service you added in Services Administration. |
If only one Address Service exists, then it is selected by default.
You're now ready to use Google Places-enabled address search.
Setting Up a Canada Post Service in Service Administration
The first step in using the Canada Post address look-up is adding the Canada Post service. You'll do this in Services Administration. You must have a Canada Post API key to set up a Canada Post Service.
To learn more about getting a Canada Post API key, visit the following link: https://www.canadapost-postescanada.ca/ac/support/setup-guides/#create-an-api-key.
|
1.
|
At the top right of the Unqork Designer Platform, click the drop-down. |
|
3.
|
Under Integration, select Services Administration to open the Services Administration page. |
|
4.
|
Click + Add a Service. |
|
5.
|
In the Service Title field, enter {teamName} - Canada Post. Replace {teamName} with your initials or the name of your application team. For example: Sales - Canada Post. |
|
6.
|
In the Service Name field, enter {teamName}-canada-post. |
Use lowercase alphanumeric characters along with a hyphen (-). A Service Name cannot start or end with a hyphen. There cannot be consecutive hyphens in a Service Name.
|
7.
|
Click Create. The service's information page displays. |
|
8.
|
Click Edit. |
|
10.
|
From the Authentication method drop-down, select Canada Post. |
|
11.
|
Enter the Canada Post API key. |
|
12.
|
Click Save Changes. The Services Administration page loads, displaying the new service at the top of the list. |
Configuring an Address Search Component to Use the Canada Post Service
Configure an Address Search component to use the Canada Post service. These instructions assume that you have an open module saved with a title.
|
1.
|
Drag and drop an Address Search component onto your canvas. |
|
2.
|
In the field, enter address. |
|
3.
|
In the field, enter Enter Your Address:. |
|
4.
|
Check any of the Show Street, Show Street 2, Show City, Show State, Show Zip, and Show Country checkboxes as desired. Checked fields display in Express View and populate with the data returned by the Canada Post API. |
All location data returned by the Canada Post API stores in the submission data, even if you don't check the respective checkbox.
|
5.
|
From the component's configuration window, select the Data tab. |
|
6.
|
From the Place Service options, select Canada Post. |
|
7.
|
From the Select API drop-down, select the Address Service created in the previous section. In this case, Sales - Canada Post. This connects your Address Search component to the Google Places service you added in Services Administration. |
If only one Address Service exists, then it is selected by default.
You're now ready to use Canada Post-enabled address search.
Best Practices
-
When setting up a new service, it is the customer/creators responsibility to obtain an API key for the Google Places or Canada Post services. API Keys are owned by the customer and should not be exposed to end-users.
-
When naming a new service, set the Service Title field to be the same as the Service name except with proper spacing and capitalization. For example: Sales - Google Places.
-
When creating a new service, set the Service name to include the team name and type of service. Use lowercase alphanumeric letters and dashes for spaces. For example: sales-google-places.
-
Address Services must have the same Service name value when promoting Address Search configurations between environments.
-
Unqork recommends using separate API keys across multiple environments and environment levels (UAT, QA, Production). Separate API Keys for Production environments allows for finer control and to provide optimal service to end-users.
Resources