Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eiriksm/api_keys
https://github.com/eiriksm/api_keys
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/eiriksm/api_keys
- Owner: eiriksm
- Created: 2015-11-21T17:42:51.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-23T21:02:39.000Z (about 9 years ago)
- Last Synced: 2024-11-07T19:51:54.091Z (about 2 months ago)
- Language: PHP
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# API keys authentication provider for Drupal 8 REST module
## Example config
```
resources:
'entity:log':
GET:
supported_formats:
- hal_json
supported_auth:
- api_keys
POST:
supported_formats:
- hal_json
supported_auth:
- api_keys
PATCH:
supported_formats:
- hal_json
supported_auth:
- api_keys
DELETE:
supported_formats:
- hal_json
supported_auth:
- api_keys
```## Example POST request:
```
curl -H "Content-Type: application/hal+json" -H "x-drupal-api-key: 1337TR0ll0ll0lOl" http://example.com/entity/log -d '{"_links": {"type": {"href": "http://example.com/rest/type/log/temperature"}},"name": [{"value": "test"}]}'
```This assumes you have configured the REST resource for entity type "log" and a bundle called "temperature". If you have just added the bundle "temperature", you must clear the cache.