How to Access Retail Pro Prism REST API Meta Data

As a developer looking to customize or create an integration with Retail Pro Prism, you will need to utilize RP Prism REST APIs to read, create, or update data in the RP Prism database.

When accessing the APIs there are many data attributes (fields) on each resource. Since JSON has limited data types and you cannot easily determine what they are or the size of some types, you can access the API meta data to review information about each attribute and determine which attributes you need.

 

Accessing API Meta Data

There are two ways to access the meta data:

  • Using the RP Prism (REST) API Explorer
  • Retrieving the API meta data directly

 

Using the Prism (REST) API Explorer

The RP Prism API Explorer is provided as part of each RP Prism server.
It can be accessed from your web browser via the URL: /api-explorer

For example:  dev-prism-vm/api-explorer
which will redirect to: dev-prism-vm/api-explorer/#/services

 

Prism (REST) API Explorer

 

To access the meta data of a particular resource, click on one of the folders of a service and expand the REST Resources until you find the resource you need.
 

For example, select the RPSRESTServiceModule service and select the CUSTOMER resource:

RPSRESTServiceModule service

 

Once the meta data has loaded you will see for each attribute the data type, size, etc.

You can also view meta data about the RPC Methods in the same manner.

 

Retrieving API Meta Data Directly

Alternatively, you can access the API meta data directly by calling the REST API resource and requesting the API to return the meta data for that resource.

There are two different formats for requesting the meta data depending on the API endpoint.

The v1/rest endpoint meta data is accessed by adding /meta/ to the URL after the resource.  
For example: http://dev-prism-vm/v1/rest/customer/meta/

The above example URL for retrieving the customer meta data as JSON will result in something like this:

[
    {
        "attributename": "Station",
        "attributesource": "customer",
        "parentattribute": null,
        "attributetype": "PERSISTED",
        "fieldname": "Station",
        "refentityname": null,
        "routename": null,
        "datatype": "STRING",
        "attributesize": 1,
        "valuelistname": null,
        "filterable": true,
        "sortable": true,
        "readonly": false,
        "printable": true,
        "sortbycase": false,
        "formulaname": null,
        "comment": "Station code\r\n",
        "required": false,
        "identifiedresource": null,
        "valuelist": null,
        "immutable": false,
        "identifyingattribute": false
    },
    ...
    {
        "attributename": "Email_Address",
        "attributesource": "customer",
        "parentattribute": null,
        "attributetype": "LOOKUP",
        "fieldname": "Email_Address",
        "refentityname": "CUSTOMER_EMAIL",
        "routename": "CUSTOMER->CUSTOMER_EMAIL_PRIMARY",
        "datatype": "STRING",
        "attributesize": 100,
        "valuelistname": null,
        "filterable": true,
        "sortable": true,
        "readonly": true,
        "printable": true,
        "sortbycase": true,
        "formulaname": null,
        "comment": "Comment Pending\r\n",
        "required": false,
        "identifiedresource": null,
        "valuelist": null,
        "immutable": false,
        "identifyingattribute": false
    }
]

 

The data can also be returned as XML by specifying text/XML as the API return data type:


 
    Station
    customer
   
    PERSISTED
    Station
   
   
    STRING
    1
   
    true
    true
    false
    true
    false
   
    Station code
   

    false
   
   
    false
    false
 

  ...
 
    Email_Address
    customer
   
    LOOKUP
    Email_Address
    CUSTOMER_EMAIL
    CUSTOMER->CUSTOMER_EMAIL_PRIMARY
    STRING
    100
   
    true
    true
    true
    true
    true
   
    Comment Pending
   

    false
   
   
    false
    false
 


 

 

All of the other endpoints will return meta data by specifying the INTROSPECTION parameter ( ?introspection=true ) after the resource name in the URL.

For example: http://dev-prism-vm/api/common/employee?introspection=true

will return:
[
    {
        "attributename": "Sid",
        "attributesource": "employee",
        "attributetype": "PERSISTED",
        "fieldname": "SID",
        "refentityname": null,
        "datatype": "INT64",
        "attributesize": 0,
        "readonly": false,
        "comment": null,
        "translationid": null,
        "required": true,
        "identifyingattribute": false,
        "v9filterable": false,
        "lookupwhere": null
    },

   {
        "attributename": "EmployeeExtend",
        "attributesource": "employee",
        "attributetype": "COLLECTION",
        "fieldname": "EmployeeSid",
        "refentityname": "TEmployeeExtend",
        "datatype": null,
        "attributesize": 0,
        "readonly": false,
        "comment": null,
        "translationid": null,
        "required": false,
        "identifyingattribute": false,
        "v9filterable": false,
        "lookupwhere": null
    }
]

These endpoints only support returning JSON data and do not support the XML format.

 

Published on May 2, 2020 in Plugins & Integrations, Customization

 

Find Another Article