Get and Patch Collaboration Relationships
You can use REST API to get a list of collaboration relationship candidates. Each collaboration relationship candidate is a potential relationship that the application published to Oracle Supply Chain Collaboration Cloud but has not created as a collaboration relationship.
Let's discuss these scenarios:
-
Get collaboration relationships according to a supplier.
-
Patch an existing relationship with new attributes.
Get Collaboration Relationships According to a Supplier
For this example, you view and update the commit horizon for every relationship where the items are shipped from your supplier. Assume your customer wants to retrieve all collaboration relationship candidates for a specified supplier.
Here's a typical application processing flow for the scenarios:
-
You send a REST API request from the client to the server.
-
The response payload includes details that describe the results of the request.
-
Your partner application extracts the values for these attributes from the response payload, and then displays them in fields in the client.
Attribute Description RelationshipNumber
Value that uniquely identifies the relationship.
ShipFromSupplierName
Name of the supplier that ships the item.
ShipFromSupplierSiteName
Name of the supplier site that ships the item.
ShipToOrganizationName
Name of the organization that receives the item.
ItemNumber
Number of the item.
ForecastHorizonInDays
Number of days in the future that the order forecast will contain forecast quantities.
CommitHorizonInDays
Number of days in the future that the order forecast will contain commit quantities.
Example URL
Use this resource URL format to get the top 200 collaboration relationships for supplier Small, Inc:.
GET
curl -u username:password "https://servername/fscmRestApi/resources/version/collaborationRelationships?limit=200 &q=ShipFromSupplierName=Small, Inc" -H 'authorization: Basic c2Ntb3BlcmF0aW9uczpXZWxjb21lMQ==' -H 'cache-control: no-cache'
Example Response
Here's an example of the response body in JSON format.
{ "items": [ { "RelationshipNumber": 1001, "ShipFromSupplierId": 909, "ShipFromSupplierName": "Small, Inc", "ShipFromSupplierNumber": "5071", "ShipFromSupplierDUNS": null, "ShipFromSupplierAlternateName": null, "ShipFromSupplierSiteId": 2814, "ShipFromSupplierSiteName": "SEATTLE", "ProcurementBU": "Vision Operations", "ShipToOrganizationId": 209, "ShipToOrganizationCode": "M2", "ShipToOrganizationName": "Tall Manufacturing", "ShipToSupplierId": null, "ShipToSupplierName": null, "ShipToSupplierNumber": null, "ShipToSupplierDUNS": null, "ShipToSupplierAlternateName": null, "ShipToSupplierSiteId": null, "ShipToSupplierSiteName": null, "InventoryItemId": 300100103293151, "ItemNumber": "SCC-TMC-02", "ItemDescription": "Item Description for SCC-TMC-02", "ItemCategory": "Uncategorized", "EffectiveStartDate": "2017-08-08", "EffectiveEndDate": "2017-08-08", "B2BMessagingConfigured": "N", "ForecastHorizonInDays": 999, "CommitHorizonInDays": 999, "SlaAction": "ORA_VCS_COMMIT_AUTOMATICALLY", "CommitPeriod": "ORA_VCS_COMMIT_HORIZON", "CommitPeriodDays": null, "CommitQuantity": "ORA_VCS_PERC_CURRENT_FORECAST", "CommitQuantityPercentage": 0.59, "CommitSlaInDays": 10, "ViewOrderForecasts": "N", "AdjustOrderForecasts": "N", "AdjustCommits": "N", "CreatedBy": "COLLABPLANNER", "CreationDate": "2017-07-12T23:30:33+00:00", "LastUpdatedBy": "COLLABPLANNER", "LastUpdateDate": "2017-07-26T16:08:57+00:00", "ObjectVersionNumber": 1, "links": [ { "rel": "self", "href": "https://servername/fscmRestApi/resources/version/collaborationRelationships/00020000000EACED00057708000110F08083A0820000000EACED00057708000110F08083A083", "name": "collaborationRelationships", "kind": "item", "properties": { "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000002770400000002737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B0200007870000000017371007E00020000000178" } }, { "rel": "canonical", "href": "https://servername/fscmRestApi/resources/version/collaborationRelationships/00020000000EACED00057708000110F08083A0820000000EACED00057708000110F08083A083", "name": "collaborationRelationships", "kind": "item" }, { "rel": "child", "href": "https://servername/fscmRestApi/resources/version/collaborationRelationships/00020000000EACED00057708000110F08083A0820000000EACED00057708000110F08083A083/child/CollaborationPlanners", "name": "CollaborationPlanners", "kind": "collection" } ] } ] }
Patch an Existing Relationship with New Attributes
Assume your customer wants to update one of the relationships retrieved with new commit horizon attribute values.
Here's a typical application processing flow for the scenarios:
-
You send a REST API request from the client to the server.
-
The response payload includes details that describe the results of the request.
-
Your partner application extracts the values for these attributes from the response payload, and then displays them in fields in the client.
Attribute Description CommitHorizonInDays
Number of days in the future that the order forecast will contain commit quantities.
Example URL
Use this resource URL format to update a single relationship with the reference key.
PATCH
curl -X PATCH -u "username:password" -H "Content-Type: application/vnd.oracle.adf.resourceitem+json" -d 'request payload' "https://servername/fscmRestApi/resources/version/collaborationRelationships/00020000000EACED00057708000110F08083A0820000000EACED00057708000110F08083A083"
Example Request
Here's an example of the request body in JSON format.
{ "CommitHorizonInDays":180 }
Example Response
Here's an example of the response body in JSON format.
{ "items": [ { "RelationshipNumber": 1001, "ShipFromSupplierId": 909, "ShipFromSupplierName": "Small, Inc", "ShipFromSupplierNumber": "5071", "ShipFromSupplierDUNS": null, "ShipFromSupplierAlternateName": null, "ShipFromSupplierSiteId": 2814, "ShipFromSupplierSiteName": "SEATTLE", "ProcurementBU": "Vision Operations", "ShipToOrganizationId": 209, "ShipToOrganizationCode": "M2", "ShipToOrganizationName": "Tall Manufacturing", "ShipToSupplierId": null, "ShipToSupplierName": null, "ShipToSupplierNumber": null, "ShipToSupplierDUNS": null, "ShipToSupplierAlternateName": null, "ShipToSupplierSiteId": null, "ShipToSupplierSiteName": null, "InventoryItemId": 300100103293151, "ItemNumber": "SCC-TMC-02", "ItemDescription": "Item Description for SCC-TMC-02", "ItemCategory": "Uncategorized", "EffectiveStartDate": "2017-08-08", "EffectiveEndDate": "2017-08-08", "B2BMessagingConfigured": "N", "ForecastHorizonInDays": 999, "CommitHorizonInDays": 180, "SlaAction": "ORA_VCS_COMMIT_AUTOMATICALLY", "CommitPeriod": "ORA_VCS_COMMIT_HORIZON", "CommitPeriodDays": null, "CommitQuantity": "ORA_VCS_PERC_CURRENT_FORECAST", "CommitQuantityPercentage": 0.59, "CommitSlaInDays": 10, "ViewOrderForecasts": "N", "AdjustOrderForecasts": "N", "AdjustCommits": "N", "CreatedBy": "COLLABPLANNER", "CreationDate": "2017-07-12T23:30:33+00:00", "LastUpdatedBy": "COLLABPLANNER", "LastUpdateDate": "2017-08-31T08:28:56+00:00", "ObjectVersionNumber": 1, "links": [ { "rel": "self", "href": "https://servername/fscmRestApi/resources/version/collaborationRelationships/00020000000EACED00057708000110F08083A0820000000EACED00057708000110F08083A083", "name": "collaborationRelationships", "kind": "item", "properties": { "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000002770400000002737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B0200007870000000017371007E00020000000178" } }, { "rel": "canonical", "href": "https://servername/fscmRestApi/resources/version/collaborationRelationships/00020000000EACED00057708000110F08083A0820000000EACED00057708000110F08083A083", "name": "collaborationRelationships", "kind": "item" }, { "rel": "child", "href": "https://servername/fscmRestApi/resources/version/collaborationRelationships/00020000000EACED00057708000110F08083A0820000000EACED00057708000110F08083A083/child/CollaborationPlanners", "name": "CollaborationPlanners", "kind": "collection" } ] } ] }