Step 3: Deploy Websites
The video below walks through the instructions for this step.
Next, you will deploy a set of configuration files to your new sub-account. This will spin up some data in the Knowledge Graph (specifically the same test data that you used during local development), link your GitHub repository from the parent account, and deploy a site, all from a single API request!
In Postman, open up the Agreements API > Create Knowledge Graph, Repo, and Site request. This request utilizes the Resources Apply Request endpoint, which allows you to deploy a set of configuration files from a GitHub repo.
If you open up the Body tab, you’ll see several variables that you’ll need to provide values for. Once again, open up your Reseller Environment Template and populate the following variables under the “current value” column:
repo_url
- The URL of the Pages GitHub repo that you created with theyext pages new
command.branch
- The branch of your Pages GitHub repo. Set this as the default branch from your GitHub repo (which should bemaster
).repo_id
- The ID of the repo object that will be created in your sub-account, associated with yourrepo_url
. For now, set this asreseller-starter-repo
.site_id
- The ID of the site you will be deploying to your sub-account. For now, set this asreseller-starter-site
.site_name
- The name of the site you will be deploying to your sub-account. For now, set this asReseller Starter Site
.location_name
- The name of the business you will be creating. For now, set this asLocal Business
.location_address_line1
- The first line of the business’s address. For now, set this as61 9th Ave
.location_address_region
- The region of the business’s address. For now, set this asNY
.location_address_postalcode
- The postal code of the business’s address. For now, set this as10011
.location_country_code
- The country abbreviation of the business’s address. For now, set this asUS
.location_entity_id
- The entity ID of the business you will be creating. For now, set this astest-location
.location_locale_code
- The locale code of the test entity you will be creating. For now, set this asen
.logo
- An image URL for the business logo. For now, set this ashttps://logos-download.com/wp-content/uploads/2020/06/Yext_Logo.png
.
Once you have saved your template variables, navigate back to the request and click send. After a few seconds, Yext will return a response that contains a numeric
id
, which you will use to obtain the status of your request with a separate endpoint.- Copy this
id
, and open up your Reseller Environment Template. Paste this ID into the “current value” column forresources_apply_request_id
. - Open up the Agreements API > Resources Apply Status request and click send. If the API response status is
COMPLETE
, your data and website was successfully deployed!
- Copy this
Navigate to your first sub-account and inspect the Knowledge Graph and Pages. You should see the location business entity, as well as a new website.
Congratulations, you have just deployed your first website!
(Optional) Refer to Using the Agreements API Endpoints guide for a full walkthrough of the Agreements API. The Agreements API can be used for myriad use cases, for example:
- Create a sub-account and location data ( Create New Location )
- Fetch all available services ( Available Services: List )
- Cancel an Account ( Cancel sub-account )
Congratulations. You have successfully created your first fleet of sites!