Developing an Application to Create or Change User Qualification Values
Use these steps to develop an application to create or change user qualification values.
Prerequisites
-
To create an application and request access to use the SAP Ariba APIs relevant to this feature, you must have access to the SAP Ariba Developer Portal. For details refer to Steps to Start Using the SAP Ariba APIs in Help for the SAP Ariba Developer Portal.
-
All queries made to this API must be authenticated using OAuth authentication. For details refer to SAP Ariba Developer Portal Authentication in Help for the SAP Ariba Developer Portal.
Context
Procedure
- Obtain the following information:
-
The ID (user ID) of the user who is creating or changing user qualification field values, such as a member of the Customer User Admin group.
-
The ID of each user that you want to configure user qualification field values for.
-
The password adapter for each user. SAP Ariba solutions use password adapters to distinguish between users that have same user names. The default password adapter values are PasswordAdapter1 (for internal users at your company, the buyer organization) and SourcingSupplierUser (for external supplier and customer organization users).
-
The unique name for each user qualification field configured on your site. The unique names are specified in the UniqueName column in file imported by the Import User Qualification Fields task.
-
The user qualification field values that you want to match for each user.
-
- Configure user qualification values for users.
Post a request to the User Qualification API qualifications endpoint to create user qualification data records:
POST {{runtime_URL}}/qualifications?user=user&passwordAdapter=passwordAdapter&realm=realmBody:{ "values": [ { "uniqueName": "userId", "passwordAdapter": "passwordAdapter", "qualificationInfo": [ { "uniqueName": "userQualificationField", "values": [ fieldValues...] }... ] }... ] }Query String Parameters (Used in All Queries for This API) Query String Parameter
Description
user
User ID of the person creating (or updating) user qualification data records.
passwordAdapter
Password adapter used to authenticate the user, such as PasswordAdapter1.
realm
Your site name.
Request Body Parameters Name
Description
values
Array with entries for users. Each user entry specifies the user qualification field values used to validate the user for a project.
"uniqueName": "userId"
Specifies the user ID of the user for whom the user qualification field values are defined.
"passwordAdapter": "passwordAdapter"
Specifies the password adapter for the user for whom the user qualification field values are defined, such as PasswordAdapter1.
qualificationInfo
Array with entries for the user qualification fields and field values used to validate the user for a project (determine if the user can be added to the project team or approval flows in the project).
"uniqueName": "userQualificationField"
Specifies the unique name of the user qualification field. The userQualificationField value must match the unique name of a user qualification field configured for your site, as specified in the UniqueName column in the file imported by the Import User Qualification Fields task.
values
Array of user qualification field values for the user. These values are compared with the value or values for the project field mapped to the user qualification field.
For simple data types, such as text or a value from an enumerated list of strings, enter the value.
For complex data types, such as flex master data objects (records), specify the UniqueName for the object, which is shown in the ID column of the chooser for the project field.
POST request:
POST {{runtime_URL}}/qualifications?user=admin1&passwordAdapter=PasswordAdapter1&realm=mySiteRequest body:
{ "values": [ { "uniqueName": "UserA", "passwordAdapter": "PasswordAdapter1", "qualificationInfo": [ { "uniqueName": "Field1", "values": [ "AAA" ] }, { "uniqueName": "Field2", "values": [ "BBB", "CCC" ] } ] } { "uniqueName": "UserB", "passwordAdapter": "PasswordAdapter1", "qualificationInfo": [ { "uniqueName": "Field1", "values": [ "AAA" ] }, { "uniqueName": "Field2", "values": [ "DDD" ] } ] } ] }In this example, the site has 2 user qualification fields defined, Field1 and Field2, that are mapped to custom sourcing project header fields with the same names. The request creates user qualification data records for the users UserA and UserB with the following results:
-
UserA is validated for a project (can be added as a project team member or to an approval flow in the project) if both the following conditions are met:
-
The project field Field1 is set to any of the following values:
- AAA
- No value (an empty project field value matches any user qualification field value)
-
The project field Field2 is set to any of the following values:
- BBB
- CCC
- BBB and CCC
- No value (empty field)
-
-
UserB is validated for a project if both the following conditions are met:
-
The project field Field1 is set to any of the following values:
- AAA
- No value
-
The project field Field2 is set to any of the following values:
- DDD
- No value (empty field)
-
-
- Optional: If you want to change values in a user qualification data record, use a PUT request using the same body syntax for creating user qualification data records.
A PUT request deletes all values in the user qualification data records for the specified users before adding the information in the request, so a PUT request must include values for all user qualification fields for each user entry in the request.
In a PUT request, the qualificationInfo for a user can also add entries for new user qualification fields.
Every user specified in the PUT request must have user qualification data record that was previously created with a POST request.
PUT request:
PUT {{runtime_URL}}/qualifications?user=admin1&passwordAdapter=PasswordAdapter1&realm=mySiteRequest body:
{ "values": [ { "uniqueName": "UserA", "passwordAdapter": "PasswordAdapter1", "qualificationInfo": [ { "uniqueName": "Field1", "values": [ "ZZZ" ] }, { "uniqueName": "Field2", "values": [ "BBB", "CCC" ] } ] } ] }This PUT request changes the configuration created in 2 so that UserA is validated for projects which have the Field1 value ZZZ instead of AAA. Because a PUT request deletes all values in the user qualification data records for the users in the request before adding the new user values in the request, you must also include the current UserA values for the Field2 field.
- Optional: If you no longer want to use the user qualification mechanism for a user, you must delete all values in the user qualification data record for that user. Use a PUT request using the same body syntax for creating a user qualification data record but with an empty qualificationInfo array for the user.
PUT request:
PUT {{runtime_URL}}/qualifications?user=admin1&passwordAdapter=PasswordAdapter1&realm=mySiteRequest body:
{ "values": [ { "uniqueName": "UserB", "passwordAdapter": "PasswordAdapter1", "qualificationInfo": [ ] } ] }This PUT request turns off user qualification checking for UserB (as configured in 2) so that and UserB can be added to any sourcing project or approval flow. The request contains an entry for UserB with an empty qualificationInfo array.