Overview
Authorizing an Account
The following steps will guide you through configuring Drupal to work with Azuqua.
Step 1: Set up REST API Endpoints
- {{auth.domain}}/node?_format=json
- {{auth.domain}}/node/{{input.Read By.Content ID}}?_format=json
- {{auth.domain}}/node/{{input.Delete By.Content ID}}
- {{auth.domain}}/node/{{input.Update By.Content ID}}?_format=json
- {{auth.domain}}/node/{{input.Update By.Content ID}}
- {{auth.domain}}/comment
- {{auth.domain}}/comment/{{input.Read By.Comment ID}}?_format=json
- {{auth.domain}}/taxonomy/term
- {{auth.domain}}/taxonomy/term/{{input.Read By.Tag ID}}?_format=json
- {{auth.domain}}/entity/date_format/medium?_format=json
These two endpoints are setup via Drupal views:
- {{auth.domain}}/api/v1/searchTags
- {{auth.domain}}/api/v1/searchNodes?_format=json
Enable and create a REST API Endpoint
- Install Rest IU module: https://www.drupal.org/project/restui
- Download https://www.drupal.org/project/restui/releases/8.x-1.15
- Install module: /admin/modules/install
Click Extend from Manage menu and enable Web Services
Step 2: Set up Views
Click on Structure on the top left. Click on **Views.
**
Click on Add View button.
Complete setting up the following views:
- searchNodes
- searchTags
searchNodes
path: /api/v1/searchNodes
- Click Format: Settings to enable request formats
Click Show: fields
- Add the following fields: ID, Title, Body, Changed, Content type, Authored on, Promoted to front page, Sticky at top of list, Tags
Update Filter Criteria, Sort Criteria, Path settings per this screenshot
For the fields “Changed” and “Authored” on Date format should be “HTML Datetime format:2018-02-23T09:34:28+0000”
searchTags
path: /api/v1/searchTags
Format settings
Set up fields, sort criteria, path settings per screenshot
Configure fields
Name – unselect the “Link to the Taxonomy term”
Descriptions – select “Strip HTML tags”
Configure REST Server Settings
Under Configuration -> REST
Enable the following 4 resources with configurations displayed under “Description”:
Authentication
Note: when creating a connection to Drupal in Azuqua, the ‘Domain’ field should be something like ‘http://test.pantheonsite.io' that includes the ‘http://’ or ‘https://’ and excludes the ending slash.
Events
-
New Content
Start FLO when new content is created.
-
Updated Content
Start FLO when existing content is updated.
Actions
-
Create Comment
Create a comment on content.
-
Create Content
Create content with HTML in the body.
-
Create Tag
Create a tag and return the tag ID.
-
Delete Content
Delete content using the content ID.
-
Read Comment
Read a comment using the comment ID.
-
Read Content
Read content using the content ID.
-
Read Tag
Read a tag using tag ID.
-
Search Tags
Search tags using filters.
-
Update Content
Update content using the content ID.