-1

I am using the JSON:API module.

I need to create vocabularies and terms through the endpoint, but it is only accepting GET requests.

Am I using the wrong route or endpoint?

1
  • Welcome to Drupal Answers! The question should not only describe what you are trying to achieve, but also what you tried so far. What documentation did you read about that module or the routes it uses? What exactly don't you understand in that documentation? What did you try so far?
    – apaderno
    Commented Sep 6, 2022 at 8:00

1 Answer 1

2

JSON:API uses the entity machine names by default. (You can change the names with the JSON:API Extras module.)

If you don't know the machine name, you can install the JSON:API Explorer module, which will provide you with a nice UI at http://www.example.com/jsonapi/explorer/app. Just install the module and visit the URL for your site and you will be able to check everything that is available by JSON:API.

2
  • Thks. But i need to create vocabularys, but the endpoint doesn't work. the endpoint /jsonapi/taxonomy_vocabulary/taxonomy_vocabulary no working for Request POST, PATCH, DELETE, this is only working for Request ytpe GET and filters. Commented Sep 7, 2022 at 14:08
  • 1
    @ArianaRomero By default, JSON:API only allows GET operations. You need to enable the setting for POST, PATCH, and DELETE at /admin/config/services/jsonapi. Commented Sep 8, 2022 at 8:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.