Skip to main content
Drupal 8

Main navigation

  • Home
    • Question And Answer
    • NEWS
    • Projects
  • Tutorials - Drupal
    • Android
    • Other
User account menu
  • Log in

Breadcrumb

  1. Home

Drupal 8 RESTful Web Services

By editor , 19 October, 2016
Question

How to use the drupal 8 native webservices REST API ?

Step 1: Activate RESTful Webservice

Active modules:
HAL (hal)
RESTful Web Services (rest)    
HTTP Basic Authentication (basic_auth)

Download and active contrib modules:
REST UI (restui)

Step 2: Configure

Go to the Rest configure page (Administration -> Configuration -> Web services -> Rest )

- Select the service / Url to enable webservice
- Select the Methode (GET/POST/DELETE/PATCH)
- Select request formats (hal_json, json, xml ... Ex, here : hal_json)
- Select Authentication type (here : basic_auth)

 

Step 3 : Call Web Services

Example : Read a node
http://mysite.com/node/1?_format=hal_json

Tags

  • Drupal 8
  • Code
  • WebService
How to create a JSON web service on drupal 8 ?

Comments

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.

Links

  • Drupal.org
  • Drupal core release cycle
  • Drupal events with ease
  • Unit test with Drupal using PHPUnit (Drupal 10)
  • Tokens for file upload url
  • Tips for Docker
  • CKEditor inline image files usage for custom forms.
  • Install Docker on Linux Mint
  • Install PHP 8.1
  • Drupal Security Best Practices
  • Order and sort items with tabledrag
  • Add a custom service YAML container
  • Apply a patch with composer