mandatory REST Services return

Options

(this was a question sent into the SDK email alias for D2 Smart View SDK partner challenge. It might help others, so I am reposting)

What is the minimal the REST services need to return for D2SV UI component to work?

Let me explain a bit futher.

I want to trigger a run of a report.  That returns the basic information:

{

  "id": "/myInsight/run_report_output",
  "report_id": "090000018001596e",
  "log_id": "090000018001596c",
  "status": "OK_WITH_ID"
}

On receive of this message, the UI should be able to next trigger an other service to get the results of the report, which he can fetch with the report_id

Is this data structure enough, Should there be a specific datastructure it has to adhere to?

Or is this a bad practice to just return the basic needs?


Kyle Pettit
Documentum D2 Product manager

Answers

  • Kyle Pettit
    Kyle Pettit E mod
    edited July 21, 2023 #2
    Options

    Reply:

    So, you can define the boilerplate REST controller the workspace assistant which can be used to create a regular rest service. So D2 doesn't mandate on any particular structure for the response. [Guide is available on Support.opentext.com]

    As for the UI component, you can use a standard AJAX method to fire those REST end point which is created. So ideally it will be good to use the connector object from the D2 Smartview while firing the AJAX as it will handle passing the necessary D2 headers. Please do find a sample snippet for firing the REST endpoint as shown below.


    Kyle Pettit
    Documentum D2 Product manager