Skip to navigation

Task 3 - Create and-fetch a Group

View as Markdown

Task 3 - Create a Group

A group represents a specific functional real-world group under an organization. A group is a container of libraries. Groups insulate the library in your group from the library in other groups. Even if another group has a library with the same name as your library, it would not matter. This is because the Forge Schema service factors in the group in the unique ID that it assigns to your library.

Every group is private by default. The creator of the group has read, write, and delete access to the group.

Expected task outcome

By the end of this task you will be able to:

  • Create a new group.
  • Fetch details of group.

Endpoints used in this task

You will use the following API endpoints in this task:

.. list-table:: :widths: 10, 50, 40 :header-rows: 1

    • Method
    • Endpoint
    • Operation
    • POST
    • /organizations/{organizationId}/groups
    • Create a Group_
    • GET
    • /organizations/{organizationId}/groups/{groupId}
    • Fetch a Group_

Step 1 - Create a Group

In postman, Select Task 3 > POST Create a Group and click Send. The equivalent cURL request is as follows.

Request

curl -X POST \
'https://developer-stg.api.autodesk.com/schema/v3/organizations/<ORGANIZATION_ID>/groups' \
-H 'Authorization: Bearer <YOUR_ACCERSS_TOKEN>' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-D '{
"name": "<GROUP_ID>",
"title": "<GROUP_TITLE>",
"description": "<GROUP_DESCRIPTION>"
}

|

Response

{
"name": "<GROUP_ID>",
"title": "<GROUP_TITLE>",
"description": "<GROUP_DESCRIPTION>",
"createdBy": "AYK3q05maQE8bVpTG2sTnYwPj0Jn6f8J",
"createTime": "2022-08-11T06:05:57Z",
"lastModifiedBy": "AYK3q05maQE8bVpTG2sTnYwPj0Jn6f8J",
"lastModifiedTime": "2022-08-11T06:05:57Z"
}

Step 2 - Fetch a Group

In Postman, Select Task 3 > GET Fetch a Group and click Send. The equivalent cURL request is as follows.

Request

curl -X GET \
'https://developer-stg.api.autodesk.com/schema/v3/organizations/<ORGANIZATION_ID>/groups/<GROUP_ID>' \
-H 'Authorization: Bearer <YOUR_ACCERSS_TOKEN>' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \

|

Response

{
"name": "<GROUP_ID>",
"title": "<GROUP_TITLE>",
"description": "<GROUP_DESCRIPTION>",
"permissions": [
{
"Id": "read",
"Effect": "Allow",
"Subjects": {
"Service": [
"AYK3q05maQE8bVpTG2sTnYwPj0Jn6f8J"
]
},
"Action": "read"
},
{
"Id": "admin",
"Effect": "Allow",
"Subjects": {
"Service": [
"AYK3q05maQE8bVpTG2sTnYwPj0Jn6f8J"
]
},
"Action": "admin"
},
{
"Id": "write",
"Effect": "Allow",
"Subjects": {
"Service": [
"AYK3q05maQE8bVpTG2sTnYwPj0Jn6f8J"
]
},
"Action": "write"
},
{
"Id": "delete",
"Effect": "Allow",
"Subjects": {
"Service": [
"AYK3q05maQE8bVpTG2sTnYwPj0Jn6f8J"
]
},
"Action": "delete"
}
],
"createdBy": "AYK3q05maQE8bVpTG2sTnYwPj0Jn6f8J",
"createTime": "2022-08-09T03:09:26Z",
"lastModifiedBy": "AYK3q05maQE8bVpTG2sTnYwPj0Jn6f8J",
"lastModifiedTime": "2022-08-09T03:09:26Z"