Warning: This document is for an old version of Grey Matter. The latest version is v10.1.0.

Reports APIs

GreyMatter provides various reports via async API calls. The usual workflow for these reports is:

  1. Hit an endpoint to generate a report with optional parameters
  2. Receive a notification with the report URL
  3. Download the report from the provided URL in the notification

Inventory Sync Report

This report data can be used to perform an inventory matching operation between your system and GreyMatter.

POST /api-gateway/platform-dashboard/report/generate-inventory-report

This endpoint will generate a CSV format report with all the unique fields’ values of each product and it’s quantity.

Request Headers:
 
  • Content-Type – the request’s content-type has to be passed in this header
  • Accept – the response content type depends on Accept header
  • Authorization – OAuth token to authenticate
Status Codes:

Example request:

POST /api-gateway/platform-dashboard/report/generate-inventory-report HTTP/1.1
Host: example.com
Content-Type: application/json
Accept: application/json, text/javascript

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8

{"id": 1000}

Example Notification

{
    "notification_type": "report_generation",
    "version_number": "1.5.0",
    "notification_seq": "unique_id_of_this_notification",
    "notification_data": {
        "id": 1000,
        "type": "inventory/GR",
        "report_url": "http://<url>",
        "requested_time": "2017-11-22T12:18:32.553543+05:30",
        "generated_time": "2017-11-22T12:18:33.553543+05:30"
    }
}

Example Report CSV

product_sku,client_id,quantity
GA00139-US,1011,150
GA00244-US,1011,79
GA00101-US,1023,340