Updating Project Groups by Using the Sourcing Project Management API

This procedure describes how to use the Sourcing Project Management API to update project groups in a sourcing project team and groups within a project group.

Prerequisites

Context

The PUT /projects/{projectId}/teams/{teamId}/groups endpoint of the Sourcing Project Management API enables you to update project groups in a sourcing project team and groups within a project group.

Procedure

  1. Obtain the ID of the sourcing project for which you want to update project groups. You can view the project ID in the user interface.
    • The classic SAP Ariba Sourcing user interface shows the project ID below the Overview tab, in the ID field.

    • The guided sourcing user interface shows the project ID in the upper left corner of the project page, below the project name.

  2. Use the GET /projects/{projectId}/teams endpoint to retrieve all the project team details, including the groups and users of a project team in a sourcing project.

    Example:

    GET {{runtime_URL}}/projects/WS4444444/teams?user=myUser&passwordAdapter=PasswordAdapter1&realm=mySite

    The project group ID (id) value that you have obtained from the response will be used as the teamId value in steps 3 and 4. For example, PG12345678.

    If members of group type (for example, Surrogate Bidders, Event Administrator) are assigned to a team, the details appear in the childgroups field in the response. If members of group type are not assigned to a team, the childGroups field will appear as an empty array in the response.

    If members of user type (for example, mallen, asugiyama) are assigned to a team, the user details appear in the users field in the response. If members of user type are not assigned to a team, the users field will appear as an empty array in the response.

    {
        [
            {
                "id": "PG12345678",
                "name": "SourcingContentEditor",
                "nameDefaultTranslation": "SourcingContentEditor",
                "type": "ProjectGroup",
                "isGlobal": false,
                "isDeletable": true,
                "isOwner": false,
                "isEditable": true,
                "roles": [
                    {
                        "uniqueName": "Sourcing Content Editor",
                        "name": "Sourcing Content Editor"
                    }
                ],
                "childGroups": [],
                "users": [
                    {
                        "uniqueName": "mallen",
                        "passwordAdapter": "PasswordAdapter1",
                        "name": "Mike Allen",
                        "emailAddress": "mallen@ariba.com",
                        "organization": "Buyer Organization",
                        "orgANId": "AN02000922351",
                        "orgName": "Buyer Organization",
                        "timeZoneID": "US/Pacific",
                        "localeID": "en_US",
                        "isRecommended": false
                    },
    					...
                ]
            },
            {
                "id": "PG3274002",
                "name": "Project Owner",
                "nameDefaultTranslation": "Project Owner",
                "type": "ProjectGroup",
                "isGlobal": false,
                "isDeletable": false,
                "isOwner": true,
                "isEditable": true,
                "roles": [
                    {
                        "uniqueName": "ProjectManager",
                        "name": "Project Owner"
                    }
                ],            
                "childGroups": [
                    {
                        "uniqueName": "Surrogate Bidders",
                        "name": "Surrogate Bidders",
                        "nameDefaultTranslation": "Surrogate Bidders",
                        "isGlobal": true,
                        "isDeletable": false,
                        "isOwner": false,
                        "isEditable": false,
                        "roles": null,
                        "childGroups": null,
                        "users": null
                    },
                    {
                        "uniqueName": "Event Administrator",
                        "name": "Event Administrator",
                        "nameDefaultTranslation": "Event Administrator",
                        "isGlobal": true,
                        "isDeletable": false,
                        "isOwner": false,
                        "isEditable": false,
                        "roles": null,
                        "childGroups": null,
                        "users": null
                    }
                ],
                "users": [
                    {
                        "uniqueName": "asugiyama",
                        "passwordAdapter": "PasswordAdapter1",
                        "name": "Akemi Sugiyama",
                        "emailAddress": "customersupportadmin@ariba.com",
                        "organization": "Buyer Organization",
                        "orgANId": "AN02000580680",
                        "orgName": "Buyer Organization",
                        "timeZoneID": "US/Pacific",
                        "localeID": "en_US",
                        "isRecommended": false
                    },
                    ...
                ]
            },
            ...
        ]
    }
    					
  3. (Optional) Use the GET /projects/{projectId}/teams/{teamId} endpoint to retrieve user details in a project group.

    Example:

    GET {{runtime_URL}}/projects/WS4444444/teams/PG12345678?user=myUser&passwordAdapter=PasswordAdapter1&realm=mySite

    You can specify the locale in which you want the response to return. For more information, refer to About Setting Locale for Sourcing Project Management API Responses.

    The Sourcing Project Management API returns the information about the specified project group in a sourcing project.

    {
        {
            "id": "PG12345678",
            "name": "SourcingContentEditor",
            "type": "ProjectGroup",
            "users": [
                {
                    "uniqueName": "mallen",
                    "passwordAdapter": "PasswordAdapter1",
                    "name": "Mike Allen",
                    "emailAddress": "mallen@ariba.com",
                    "organization": "Buyer Organization",
                    "timeZoneID": "US/Pacific",
                    "type": "User"
                },
                {
                    "uniqueName": "adavis",
                    "passwordAdapter": "PasswordAdapter1",
                    "name": "Arnold Davis",
                    "emailAddress": "adavis@ariba.com",
                    "organization": "Buyer Organization",
                    "timeZoneID": "US/Pacific",
                    "type": "User"
                }
            ]
        }
    }
    					
  4. To update project groups in a team for a sourcing project, use the PUT /projects/{projectId}/teams/{teamId}/groups endpoint with the team ID from step 2 or 3.

    Example:

    PUT {{runtime_URL}}/projects/WS4444444/teams/PG12345678/groups?user=myUser&passwordAdapter=PasswordAdapter1&realm=mySite

    A group is uniquely identified by uniqueName and is required in the request body.

    Use the following data model for the request body:

    [
        {
            "uniqueName": "Surrogate Bidders"
        },
        {
            "uniqueName": "Event Administrator"
        }
    ]
    					

    This example adds the groups Surrogate Bidders and Event Administrator to the PG12345678 group (SourcingContentEditor group) in the specified project. All existing groups are replaced with the groups specified in the request.

    The Sourcing Project Management API returns the information about project groups in a team for a sourcing project.

    For example:

    {
        "status": "ok",
        "code": 200,
        "messages": [
            "Success: Updated the groups to the specified team:PG15135648"
        ]
    }  
    					

    To troubleshoot your queries to the Sourcing Project Management API, refer to Error Messages Returned by the Sourcing Project Management API.