1

I seem to be having troubles creating a node through the JSON API. I am able to get nodes just fine and generate an access token via oauth but I am having no luck creating anything.

screenshot

screenshot

This is the content of the CORS file.

cors.config:
    enabled: true
    # Specify allowed headers, like 'x-allowed-header'.
    allowedHeaders: ['*']
    # Specify allowed request methods, specify ['*'] to allow all possible ones.
    allowedMethods: ['*']
    # Configure requests allowed from specific origins.
    allowedOrigins: ['*']
    # Sets the Access-Control-Expose-Headers header.
    exposedHeaders: false
    # Sets the Access-Control-Max-Age header.
    maxAge: false
    # Sets the Access-Control-Allow-Credentials header.
    supportsCredentials: true

I also have have the permissions turned on for creating a node for my content type under the consumer. Any suggestions on what I can try next?

These are the permissions for the consumer role.

screenshot

7
  • Did you turn on the CRUD permissions here /admin/config/services/jsonapi? – cchen Sep 24 '19 at 17:16
  • The role you assign as scope for your consumer has the permission to create node article? – Claire D Sep 24 '19 at 17:35
  • @cchen yes it is turned on. – Suzed Sep 24 '19 at 17:37
  • @Claire D. Yes, that was the first thing I checked. I even turned on create node for anonymous and it didnt work. – Suzed Sep 24 '19 at 17:37
  • I've added in my cors file. I dont think there is anything wrong with it since I am able to post to oauth to retrieve a token but i thought i would post it anyway. – Suzed Sep 24 '19 at 17:38

Browse other questions tagged or ask your own question.