Creating `Group` content is impossible via REST, JSON:API and GraphQL due to `$context['group']` being required in checking `create` access

Created on 25 April 2017, about 7 years ago
Updated 23 October 2023, 8 months ago

Hi
under admin/config/services/rest there are some endpoints for Rest. I can enable all the settings for GET, POST, etc..

/group/{group}/content/{group_content}

I just cannot find an example on how to use it in order to create a new group node.

Creating a node by clicking uses this link:

https://www.example.com/group/4/content/create/group_node:article

What is the proper REST/url instead of /entity/node which is used for creating non-group nodes POST.

Could someone who knows the magic please add it this documentation?

https://www.drupal.org/docs/8/core/modules/rest/javascript-and-drupal-8-... β†’

A regular node gets REST-created this way:

Create article
POST: http://example.com/entity/node
Content-type: application/json

{
  "type":[{"target_id":"article"}],
  "title":[{"value":"Hello World"}],
  "body":[{"value":"How are you?"}]
}

How do I create a group-article?

POST: http://example.com/???
Content-type: application/json

{
  "type":[{"target_id":"article"}],
  "title":[{"value":"Hello World"}],
  "body":[{"value":"How are you?"}]
}

What informations are required? URL? UUID of group? ...?

πŸ› Bug report
Status

Needs work

Version

3.0

Component

Code

Created by

πŸ‡¦πŸ‡ΉAustria maxilein

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024