Get and Patch VMI Analysts

You can use REST API to get a list of vendor-managed inventory (VMI) analysts. VMI analysts are Oracle Fusion users assigned a security context for access to vendor-managed inventory data.

For the example in this topic, assume you need to view all VMI analysts with access to vendor-managed inventory data for the supplier Big Computers. Big Computers used to supply CPUs to your organization, but now they are supplied by Small Chips. Therefore, all VMI analysts with access to the Big Computers need their access moved to Small Chips.

You create a solution that allows John Brown, your customer, to use a client to connect to your partner application, and then use REST API for additional tasks.

Let's discuss these scenarios:

  1. Get VMI analysts according to a supplier

  2. Patch a VMI analyst access from Big Computers to Small Chips

Get VMI Analysts According to a Supplier

John wants to retrieve all VMI analysts for a specified supplier.

Here's a typical application processing flow for the scenario:

  1. You use a REST API request to get all VMI analysts for supplier Big Computers.

    Note:

    In order to query child resource attribute values, you must add the header, REST-Framework-Version:2 (or above).

  2. The response payload includes details that describe the results of the request.

  3. Your partner application extracts the values for these attributes from the response payload, and then displays them in the client.

    Attribute Description

    vmiAnalysts.UserName

    Value that uniquely identifies the VMI analyst to authenticate with the service provider. This is a required attribute.

    vmiAnalysts.Status

    Administrative status of the VMI analyst. The service provider determines the value for this attribute. For example, Active indicates that the VMI analyst can access vendor-managed inventory data. Inactive indicates that the VMI analyst cannot access vendor-managed inventory data.

    dataAccessSecurity.SupplierId

    Value that uniquely identifies the supplier who ships the item. It is a primary key that the application creates when it creates the supplier.

    dataAccessSecurity.SupplierName

    Name of the supplier that ships the item.

    dataAccessSecurity.SecurityContext

    Value that identifies the level of security. Value is supplier or organization.

Example URL

Use this resource URL format.

GET

curl -u username:password "https://servername/fscmRestApi/resources/version/vmiAnalysts? q=dataAccessSecurity.ShipFromSupplierName='Big Computers'&expand=dataAccessSecurity&onlyData=True" -H 'REST-Framework-Version: 2' -H 'cache-control: no-cache'

Example Response

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

{
    "items": [
        {
            "PersonId": 300100073969092,
            "UserName": "StJones",
            "FirstName": "Steve",
            "LastName": "Jones",
            "DisplayName": "Jones, Steve",
            "Email": "sendmail-test-discard@oracle.com",
            "Status": "Active",
            "StatusCode": "A",
            "CreatedBy": "SCMOPERATOR",
            "CreationDate": "2018-10-19T09:29:01.589+00:00",
            "LastUpdatedBy": "SCMOPERATOR",
            "LastUpdateDate": "2018-10-19T09:29:07.599+00:00",
            "FullAccessFlag": "false",
            "dataAccessSecurity": {
                "items": [
                    {
                        "DataAccessId": 300100182649732,
                        "SecurityContext": "Supplier",
                        "SecurityContextCode": "ORA_VCS_SUPPLIER",
                        "SupplierId": 55,
                        "SupplierName": "Big Computers",
                        "OrganizationId": null,
                        "OrganizationCode": null,
                        "OrganizationName": null,
                        "CreatedBy": "SCMOPERATOR",
                        "CreationDate": "2018-10-19T09:28:44+00:00",
                        "LastUpdatedBy": "SCMOPERATOR",
                        "LastUpdateDate": "2018-10-19T09:29:07.595+00:00"
                    }
                ],
                "count": 1,
                "hasMore": false,
                "limit": 25,
                "offset": 0,
                "links": [
                    {
                        "rel": "self",
                        "href": "https://servername/fscmRestApi/resources/version/vmiAnalysts/300100073969092/child/dataAccessSecurity",
                        "name": "dataAccessSecurity",
                        "kind": "collection"
                    }
                ]
            }
        }
    ],
    "count": 1,
    "hasMore": false,
    "limit": 25,
    "offset": 0,
    "links": [
        {
            "rel": "self",
            "href": "https://servername/fscmRestApi/resources/version/vmiAnalysts",
            "name": "vmiAnalysts",
            "kind": "collection"
        }
    ]
}

Patch an Existing Planner with New Attributes

John wants to update VMI analyst named Steve Jones site access from Big Computers to Small Chips using the provided finders and user keys.

Here's a typical application processing flow for the scenario:

  1. You use a REST API request to update a single planner with the reference key.

  2. The server processes the request using the key SupplierName.

  3. 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 the client.

    Attribute Description
    SupplierName Name of the supplier that ships the item.

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/vmiAnalysts/300100073969092/child/dataAccessSecurity/300100182649732"

Example Request

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

{
	"SecurityContext":"Supplier", 
	"SupplierName":"Small Chips" 
}

Example Response

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

{
    "DataAccessId": 300100182649732,
    "SecurityContext": "Supplier",
    "SecurityContextCode": "ORA_VCS_SUPPLIER",
    "SupplierId": 100000012050255,
    "SupplierName": "Small Chips",
    "OrganizationId": null,
    "OrganizationCode": null,
    "OrganizationName": null,
    "CreatedBy": "SCMOPERATIONS",
    "CreationDate": "2018-10-19T09:28:44+00:00",
    "LastUpdatedBy": "SCMOPERATIONS",
    "LastUpdateDate": "2018-10-19T09:29:07.595+00:00",
    "links": [
        {
            "rel": "self",
            "href": "https://servername/fscmRestApi/resources/version/vmiAnalysts/300100073969092/child/dataAccessSecurity/300100182649732",
            "name": "dataAccessSecurity",
            "kind": "item",
            "properties": {
                "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
            }
        },
        {
            "rel": "canonical",
            "href": "https://servername/fscmRestApi/resources/11.13.18.05/vmiAnalysts/300100073969092/child/dataAccessSecurity/300100182649732",
            "name": "dataAccessSecurity",
            "kind": "item"
        },
        {
            "rel": "parent",
            "href": "https://servername/fscmRestApi/resources/version/vmiAnalysts/300100073969092",
            "name": "vmiAnalysts",
            "kind": "item"
        }
    ]
}