Skip to main content
Skip table of contents

Drupal Connector v1.0

1. Setup Drupal Site

 

image-20241231-001303.png

Provide site name and continue:

image-20240905-113338.png

Select Drupal(Composer Managed) Deploy:

image-20240905-114021.png

It will deploy new Drupal instance:

image-20240905-114110.png
image-20240905-115318.png

Goto site admin:

image-20241231-001326.png

Configure Drupal setup:

image-20240905-115512.png

2. JSON API & Authentication

JSON: API

Drupal comes with a built-in extension named JSON: API to enable its restful endpoints accessible. To make use of its APIs we need to install this extension to our Drupal application.

HTTP Basic Authentication

Drupal supports Basic Auth to authenticate requests. For this, we need to install its extension named HTTP Basic Authentication.

To enable Basic auth and enable JSON APIs for the Drupal website, go to Extend in the user menu, and at the end of the list in the Web Services mark and enable all four options and install them like below.

  • HTTP Basic Authentication

  • JSON: API

  • RESTful Web Services

  • Serialization

image-20241231-001356.png

Enable JSON API rights:

Go to Manage > Configuration > JSON:API

image-20241231-001414.png

Enable API access to create, update and delete.

image-20241231-001428.png


3. Connector Action & Tests

 

 

Action Name / METHOD

Upload: Upload File (POST)

Action Description

Create a File (POST) into Drupal (https://www.drupal.org/docs/core-modules-and-themes/core-modules/jsonapi-module/file-uploads )

Request Body Name

Parameter

Type

Description

 

Accept

String

Accept parameter is used within file upload fields to specify the types of files that are allowed for upload e.g application/vnd.api+json

-

Content-disposition

String

Content-Disposition is most commonly used to indicate an attachment, which includes metadata such as the filename e.g “file; filename="file_name.jpg​"

-

Content Type

String

application/octet-stream (default)

 

Field Name

String

"Field Name" parameter is used to specify the name of the field that will store the uploaded file data. It helps the system identify which field in the content type or entity will be used to hold the file information. e.g field_edocs_form (See section 4. Content Type below)

 

Node Type

String

Specify the content type here e.g Article (See section 4. Content Type below)

Options

File

String

image-20240704-121529.png
image-20240704-121548.png

 

Action Name / METHOD

Get Nodes (GET)

Action Description

Retrieve nodes from Drupal

Request Body Name

Parameter

Type

Description

 

Node Type

 

String

Filter node by type e.g fo, article (See section 4. Content Type below)

image-20240704-125822.png

 

Action Name / METHOD

Get Nodes (GET)

Action Description

Retrieve nodes from Drupal

Request Body Name

Parameter

Type

Description

 

Node Type

 

String

Filter node by type e.g fo, article (See section 4. Content Type below)

 

Node Type

String

Filter node by id

image-20240704-130002.png

 

Action Name / METHOD

Create File for Node (POST)

Action Description

Create a File for Node type (https://www.drupal.org/docs/core-modules-and-themes/core-modules/jsonapi-module/file-uploads )

Request Body Name

Parameter

Type

Description

 

Node Type

String

Node type can be Article, Product, fo(Form) (See section 4. Content Type below)

 

Accept

String

Accept parameter is used within file upload fields to specify the types of files that are allowed for upload e.g application/vnd.api+json

-

Content-disposition

String

Content-Disposition is most commonly used to indicate an attachment, which includes metadata such as the filename e.g “file; filename="file_name.jpg​"

-

Content Type

String

application/octet-stream (default)

 

Field Name

String

"Field Name" parameter is used to specify the name of the field that will store the uploaded file data. It helps the system identify which field in the content type or entity will be used to hold the file information. e.g field_edocs_form

Options

File

String

image-20240704-134828.png
image-20240704-134849.png

Action Name / METHOD

Get File (GET)

Action Description

Retrieve file and download from Drupal. This action downloads the file on OneTeg and provides file path in output.

Request Body Name

Parameter

Type

Description

 

Url

 

String

Path of the file to retrieve and download

image-20240708-135739.png


4. Content Type Configurations

Content type section allows you to define and manage different types of content that can be created, displayed, and managed on your Drupal site. Each content type can have its own set of fields, display settings, and behavior, making it possible to customize the way content is handled. In OneTeg Drupal connector, we are getting Node Type and Field Name from this section.

 

image-20241231-001559.png

 

image-20241231-001611.png

5. Connection Settings and Configuration

 

Settings Parameters

Value

Description

Required (Y/N)

Default Value

Connector

Drupal

Connector Name

Y

Drupal

Host Name

https://dev-oneteg-demo.pantheonsite.io

Endpoint required for performing CRUD

Y

https://dev-oneteg-demo.pantheonsite.io

Authentication

Basic Auth

Type of authentication

Y

 

Username

oneteg

User name

Y

oneteg

Password

<password>

User password

Y

<password>

 

image-20241231-001627.png

 

 

image-20241231-001712.png

 

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.