how to use drupal rest-api?archive.ihsana.net/pdf/installing-drupal-restapi.pdf · how to use...

5
How to use Drupal REST-API? 1. Install modules CORS and checked for enable. 2. Now we can setting cors setting. Go to the Configuration page and choose Cors in Web Services Panel. 3. Copy this code to domain then click Save button. *|<mirror>|GET,PUT,POST,OPTIONS|Authorization,Origin,Content-Type,X-CSRF-Token|true

Upload: others

Post on 07-Jul-2020

52 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: How to use Drupal REST-API?archive.ihsana.net/pdf/installing-drupal-restapi.pdf · How to use Drupal REST-API? 1. Install modules CORS and checked for enable. 2. Now we can setting

How to use Drupal REST-API?

1. Install modules CORS and checked for enable.

2. Now we can setting cors setting. Go to the Configuration page and choose Cors in Web

Services Panel.

3. Copy this code to domain then click Save button.

*|<mirror>|GET,PUT,POST,OPTIONS|Authorization,Origin,Content-Type,X-CSRF-Token|true

Page 2: How to use Drupal REST-API?archive.ihsana.net/pdf/installing-drupal-restapi.pdf · How to use Drupal REST-API? 1. Install modules CORS and checked for enable. 2. Now we can setting

4. Now install REST Server (Services Modules), and also Install required modules in order to set up our

REST server.

5. Now we can create our REST Server. Go to the Structure page and choose Services, and then

click on Add.

Page 3: How to use Drupal REST-API?archive.ihsana.net/pdf/installing-drupal-restapi.pdf · How to use Drupal REST-API? 1. Install modules CORS and checked for enable. 2. Now we can setting

We have a few required input fields to fill.

6. After creating Services, we need to set up Service Resources.

Go to “Edit Resources” link next to Our Service, you will see the list of resources, expand

each resource and check the one you would like to use.

Page 4: How to use Drupal REST-API?archive.ihsana.net/pdf/installing-drupal-restapi.pdf · How to use Drupal REST-API? 1. Install modules CORS and checked for enable. 2. Now we can setting

and click Save Button.

7. Now it’s time to enable Server Response Formatters and Request parsing.

8. You can test our created resource with REST client:

Example URL

http://your-drupal-site/rest-api/node.json

http:// your-drupal-site/rest-api/node/4

Page 5: How to use Drupal REST-API?archive.ihsana.net/pdf/installing-drupal-restapi.pdf · How to use Drupal REST-API? 1. Install modules CORS and checked for enable. 2. Now we can setting

9. How to connect to ionic app builder table, set properties table like this:

And column name according drupal api variable.