Manage Supplier Qualification Questions

You use the Supplier Qualification Questions REST resource to create, update and retrieve a question.

Let's discuss these scenarios:

  • Create a question
  • Update a question
  • Retrieve a question

Create a Question

In this scenario, you can create a question.

Example URL

Use this resource URL format.

POST

curl -u username:password -X POST -H "Content-Type:application/vnd.oracle.adf.resourceitem+json" -d 'request payload' 
"https://servername/fscmRestApi/resources/version/supplierQualificationQuestions"

Example Request

Here's an example of the request body in JSON format. You must enter the question text in base64 format. In this payload, the actual question text is: Do you follow the industry wide safety standards?

{
	"Question": "Safety Standards New",
	"QuestionLevel": "Supplier",
	"ResponderType": "Supplier",
	"QuestionType": "Multiple choice with multiple selections",
	"QuestionStatus": "Active",
	"ScoringMethod": "None",
	"QuestionText": "RG8geW91IGZvbGxvdyB0aGUgaW5kdXN0cnkgd2lkZSBzYWZldHkgc3RhbmRhcmRzPw==",
	"acceptableResponses": [
	{
		"DisplaySequence": 10,
		"ResponseText": "Yes we follow safety standards.”,
		},
		{
			"DisplaySequence": 20,
			"ResponseText": “No, we don't.",
		
	},
	{
		"DisplaySequence": 30,
		"ResponseText": "We might follow in future.”
			
		}
]
}

Example Response

Here's an example of the response body in JSON format. An active question is created with child resource, acceptable responses.

{
  "QuestionId": 300100194957999,
  "Revision": 0,
  "Question": "Safety Standards New",
  "QuestionLevelCode": "SUPPLIER",
  "QuestionLevel": "Supplier",
  "ResponderTypeCode": "SUPPLIER",
  "ResponderType": "Supplier",
  "SupplierAttributeFlag": false,
  "SupplierAttributeCode": null,
  "SupplierAttribute": null,
  "QuestionTypeCode": "MCMS",
  "QuestionType": "Multiple choice with multiple selections",
  "QuestionStatusCode": "ACTIVE",
  "QuestionStatus": "Active",
  "OwnerId": null,
  "Owner": null,
  "DisplayPreferredResponseFlag": null,
  "CriticalQuestionFlag": false,
  "ResponseRequiredFlag": false,
  "AllowResponderCommentsFlag": false,
  "QuestionHint": null,
  "SubjectCode": null,
  "Subject": null,
  "StandardsOrganizationCode": null,
  "StandardsOrganization": null,
  ...
  "ScoringMethodCode": "NONE",
  "ScoringMethod": "None",
  "MaximumScore": null,
  "ScoreForNoResponse": null,
  "ScoringApproachCode": null,
  "ScoringApproach": null,
  "LatestRevisionFlag": true,
  "acceptableResponses": [
    {
      "AcceptableResponseId": 300100194958000,
      "QuestionId": 300100194957999,
      "DisplaySequence": 10,
      "ResponseText": "Yes, we follow safety standards",
      ...
      
      ]
    },
    {
      "AcceptableResponseId": 300100194958001,
      "QuestionId": 300100194957999,
      "DisplaySequence": 20,
      "ResponseText": "No, we don't.”,
      ...
      "OriginalAcceptableResponseId": 300100194958001,
      "Score": null,
      "links": [
        {
         ...
        }
      ]
    },
    {
      "AcceptableResponseId": 300100194958002,
      "QuestionId": 300100194957999,
      "DisplaySequence": 30,
      "ResponseText": "We might follow in future.”,
     ...
      "OriginalAcceptableResponseId": 300100194958002,
      "Score": null,
      "links": [
    {
     ...
    }
  ]
}

Update a Question

In this scenario, you can update a new question

Upon patching the original revision of the question will not be associated with the new revision by using the REST resource.

  • For attributes that do not trigger a new question revision, you use PATCH to update the question.

    For attributes that trigger a new question revision, you use REVISE to create a new draft revision of the question first and then use PATCH to update and activate the question.

Update attributes that do not trigger revision

When you update an active question with attributes, the values are updated without increasing the revision of question. The attributes used in this scenario are Display Preferred Response, Critical Question, Allow Comments from Responder, Hint, Subject, Standards Organization, Display Sequence for Acceptable Responses, and Question Attachments.

Example URL

Use this resource URL format.

PATCH

curl -X PATCH -u "username:password" -H "Content-Type: application/vnd.oracle.adf.resourceitem+json" -d 'request payload'  "https://servername/fscmRestApi/resources/version/supplierQualificationQuestions/300100194957999"

Example Request

Here's an example of the request body in JSON format.

{
  "DisplayPreferredResponseFlag": false,
  "CriticalQuestionFlag": false,
  "AllowResponderCommentsFlag": true,
  "QuestionHint": "Please add an attachment if available",
  "Subject": "Supplier Questions",
  "StandardsOrganization": "Supplier Questions Organization"
}

Example Response

Here's an example of the response body in JSON format. The attributes in the request payload are updated but the revision is not updated.

{
  "QuestionId": 300100194957999,
  "Revision": 0,
  "Question": "Safety Standards New",
  "QuestionLevelCode": "SUPPLIER",
  "QuestionLevel": "Supplier",
  "ResponderTypeCode": "SUPPLIER",
  "ResponderType": "Supplier",
  "SupplierAttributeFlag": false,
  "SupplierAttributeCode": null,
  "SupplierAttribute": null,
  "QuestionTypeCode": "MCMS",
  "QuestionType": "Multiple choice with multiple selections",
  "QuestionStatusCode": "ACTIVE",
  "QuestionStatus": "Active",
  "OwnerId": null,
  "Owner": null,
  "DisplayPreferredResponseFlag": false,
  "CriticalQuestionFlag": false,
  "ResponseRequiredFlag": false,
  "AllowResponderCommentsFlag": true,
  "QuestionHint": "Please add an attachment if available",
  "SubjectCode": "POQ3",
  "Subject": "Supplier Questions",
  "StandardsOrganizationCode": "POQ3",
  "StandardsOrganization": "Supplier Questions Organization",
   ...
  "ScoringMethodCode": "NONE",
  "ScoringMethod": "None",
  "MaximumScore": null,
  "ScoreForNoResponse": null,
  "ScoringApproachCode": null,
  "ScoringApproach": null,
  "AttachmentAllowedCode": null,
  "AttachmentAllowed": null,
  "LatestRevisionFlag": true,
  "links": [
    {
	...
    }
  ]
}

Update attributes that trigger revision

In this scenario, you can update an active question in two steps:

  1. Create a draft question using revise function. This will increment the revision of question.
  2. Patch the draft question to activate. All the attributes except the Display Preferred Response, Critical Question, Allow Comments from Responder, Hint, Subject, Standards Organization, Display Sequence for Acceptable Responses, and Question Attachments will trigger a revision.

Create a Draft Question Using Revise Action

To run the revise action you must include QuestionId in the URL and the Content Type must be “application/vnd.oracle.adf.action+json”.The request payload is blank. The response payload will display the new QuestionId. When the draft question is created its revision is incremented.

Example URL

Use this resource URL format.

POST

curl -u username:password -X POST -H "Content-Type:application/vnd.oracle.adf.action+json" -d '{}' 
"https://servername/fscmRestApi/resources/version/supplierQualificationQuestions/300100194957999/action/revise"

Example Response

Here's an example of the response body in JSON format. A new revision of the question with a new QuestionId is created in draft status.

{
  "result": "A new revision for the question 300100194957999 was created in draft status. The new question ID is 300100194958051."
}

Update draft and activate question

You can update question attributes and the Question Status to Active in the same request payload.

Example URL

Use this resource URL format.

PATCH

curl -X PATCH -u "username:password" -H "Content-Type: application/vnd.oracle.adf.resourceitem+json" -d 'request payload'  "https://servername/fscmRestApi/resources/version/supplierQualificationQuestions/300100194958051"

Example Request

Here's an example of the request body in JSON format.

{
  "ScoringMethod": "Manual",
  "MaximumScore": 50,
  "QuestionStatus": "Active"
}

Example Response

Here's an example of the response body in JSON format. A new revision of the question with a new QuestionId is created in draft status.

{
  "QuestionId": 300100194958051,
  "Revision": 1,
  "Question": "Safety Standards New",
  "QuestionLevelCode": "SUPPLIER",
  "QuestionLevel": "Supplier",
  "ResponderTypeCode": "SUPPLIER",
  "ResponderType": "Supplier",
  "SupplierAttributeFlag": false,
  "SupplierAttributeCode": null,
  "SupplierAttribute": null,
  "QuestionTypeCode": "MCMS",
  "QuestionType": "Multiple choice with multiple selections",
  "QuestionStatusCode": "ACTIVE",
  "QuestionStatus": "Active",
  "OwnerId": null,
  "Owner": null,
  "DisplayPreferredResponseFlag": false,
  "CriticalQuestionFlag": false,
  "ResponseRequiredFlag": false,
  "AllowResponderCommentsFlag": true,
  "QuestionHint": "Please add an attachment if available",
  "SubjectCode": "POQ3",
  "Subject": "Supplier Questions",
  "StandardsOrganizationCode": "POQ3",
  "StandardsOrganization": "Supplier Questions Organization ",
   ...
  "ScoringMethodCode": "MANUAL",
  "ScoringMethod": "Manual",
  "MaximumScore": 50,
  "ScoreForNoResponse": null,
  "ScoringApproachCode": null,
  "ScoringApproach": null,
  "LatestRevisionFlag": true,
  "links": [
    {
      ...
    }
  ]
}

Retrieve a Question

In this scenario, you can retrieve questions. For example, you can use the question name or question identifier to retrieve questions. Once the newly revised question with the new revision is activated, the original question with the old revision is archived automatically. If you perform get on the question name then all QuestionId with different statuses like Active and Archive are displayed in a single payload.

Example URL

Use this resource URL format.

GET

curl -u username:password "https://servername/fscmRestApi/resources/version/supplierQualificationQuestions?q=Question like 'Safety Standards New'"

Example Response

Here's an example of the response body in JSON format. The original question with revision 0 is in Archived status and the newly revised question with revision 1 is in Active status.

{
  "items": [
    {
      "QuestionId": 300100194957999,
      "Revision": 0,
      "Question": "Safety Standards New",
      "QuestionLevelCode": "SUPPLIER",
      "QuestionLevel": "Supplier",
      "ResponderTypeCode": "SUPPLIER",
      "ResponderType": "Supplier",
      "SupplierAttributeFlag": false,
      "SupplierAttributeCode": null,
      "SupplierAttribute": null,
      "QuestionTypeCode": "MCMS",
      "QuestionType": "Multiple choice with multiple selections",
      "QuestionStatusCode": "ARCHIVED",
      "QuestionStatus": "Archived",
      "OwnerId": null,
      "Owner": null,
      "DisplayPreferredResponseFlag": false,
      "CriticalQuestionFlag": false,
      "ResponseRequiredFlag": false,
      "AllowResponderCommentsFlag": true,
      "QuestionHint": "Please add an attachment if available",
      "SubjectCode": "POQ3",
      "Subject": "Supplier Questions",
      "StandardsOrganizationCode": "POQ3",
      "StandardsOrganization": "Supplier Questions Organization ",
     ...
      "ScoringMethodCode": "NONE",
      "ScoringMethod": "None",
      "MaximumScore": null,
      "ScoreForNoResponse": null,
      "ScoringApproachCode": null,
      "ScoringApproach": null,
      "AttachmentAllowedCode": null,
      "AttachmentAllowed": null,
      "LatestRevisionFlag": false,
      "links": [
        {
          ...
        }
      ]
    },
    {
      "QuestionId": 300100194958051,
      "Revision": 1,
      "Question": "Safety Standards New",
      "QuestionLevelCode": "SUPPLIER",
      "QuestionLevel": "Supplier",
      "ResponderTypeCode": "SUPPLIER",
      "ResponderType": "Supplier",
      "SupplierAttributeFlag": false,
      "SupplierAttributeCode": null,
      "SupplierAttribute": null,
      "QuestionTypeCode": "MCMS",
      "QuestionType": "Multiple choice with multiple selections",
      "QuestionStatusCode": "ACTIVE",
      "QuestionStatus": "Active",
      "OwnerId": null,
      "Owner": null,
      "DisplayPreferredResponseFlag": false,
      "CriticalQuestionFlag": false,
      "ResponseRequiredFlag": false,
      "AllowResponderCommentsFlag": true,
      "QuestionHint": "Please add an attachment if available",
      "SubjectCode": "POQ3",
      "Subject": "Supplier Questions",
      "StandardsOrganizationCode": "POQ3",
      "StandardsOrganization": "Supplier Questions Organization",
       ...
      "ScoringMethodCode": "MANUAL",
      "ScoringMethod": "Manual",
      "MaximumScore": 50,
      "ScoreForNoResponse": null,
      "ScoringApproachCode": null,
      "ScoringApproach": null,
      "AttachmentAllowedCode": null,
      "AttachmentAllowed": null,
      "LatestRevisionFlag": true,
      "links": [
        {
        ...
    }
  ],
  "count": 2,
  "hasMore": false,
  "limit": 25,
  "offset": 0,
  "links": [
    {
      
...
    }
  ]
}