REST API Documentation
Meru Data’s Rest API will allow clients to perform actions programmatically by making use of secured endpoints. This document will explain how to create a Rest API configuration in Meru Data’s application and steps to consume API’s.
Note: The following reference images are from staging environment. Production URLs for core application UI and Rest API will be provided
Creating a Configuration
Login to Meru Data’s Application and go to Rest API Configuration from the settings Menu
Click on Add Configuration button and enter a unique name and click on “Create”.
After creating the configuration, copy the client Id and client secret, The client Id and client secret credentials should be used to fetch the Access Token, which should be used with every request to fetch data or perform actions.
Note:
- Name is the only Required field.
- Enable Allow all networks if you want the Rest API to be accessed from any IP Address.
- Other details will be auto generated.
Authentication
To consume Meru Data’s Rest API endpoints, an Access Token should be passed along with every request. Follow the steps below to fetch an Access Token
Fetching an Access Token
• Description: Used to retrieve access and refresh tokens
• Method: POST
• Url: <baseUrl>/api/Auth/RequestAccessToken
Request Headers
• ClientId: <defined in the previous step>
• ClientSecret: <defined in the previous step>
Request Body
• Type: JSON
• Scope- list of permissions required for API
{
"scope": ["RequestDetails"]
}
Sample Response:
{
"AccessToken": "<JwtToken>",
"RefreshToken": "<JwtToken>"
}
Note:
- Access Token will be valid for 1 day. Every time it expires, new Access Token can be fetched using the same API.
- After fetching the Access Token, it should be passed as a header in every request.
Get Pending Validate Action items
• Description: Used to fetch pending action item in a tenant
• Method: GET
• Url: <baseUrl>/DSR/ActionItem/{tenant}/PendingValidateItems
Note: Tenant identifier as created in Data Governance Application
Request Headers
• AccessToken: <received in the last step>
Optional Query Parameters
• domain: string
• act: string
• requestor: string
• requestType: string
• requestId: int
Note:
- Optional Parameters can be used to filter items.
Response Model(C#)
public class RestApiResponseModel// Api response model
{
public HttpStatusCode statusCode { get; set; }
public string ErrorMessage { get; set; }
public PendingValidateActionItemsV1 Response { get; set; }
}
// Other models in response
public class PendingValidateActionItemsV1
{
//List of Pending action items
public List<PendingValidateActionItem> Items { get; set; }
//Filtering options to pull specific data
public DSRFilterOptions FilterOptions { get; set; }
//List of form fields in the tenant. Should be submitted for match not found fields
public List<string> Fields { get; set; }
}
public class PendingValidateActionItem
{
//Action item id
public long Id { get; set; }
// Action item system name
public string Name { get; set; }
//Action item response configuration
public ActionItemResponse ResponseDetails { get; set; }
//Datasubject request details
public RequestDetails RequestDetails { get; set; }
//details submitted by the user
public Dictionary<string, string> CustomerData { get; set; }
}
public class RequestDetails
{
//Request identifier as in DSR Dashboard
public int Id { get; set; }
//Request type as submitted in privacy portal
public string RequestType { get; set; }
//Requestor as submitted in privacy portal
public string Requestor { get; set; }
//Region/act as submitted in privacy portal
public string Act { get; set; }
//Domain as configured in DSR Configuration
public string Domain { get; set; }
//indicates whether request is verified or not
public bool RequestVerified { get; set; }
//Date of request submission
public DateTime RequestDate { get; set; }
}
public class ActionItemResponse
{
//Action item keys as configured in dsr flow
public List<FormKey> Keys { get; set; }
//action item match options as configured in flow
public MatchOption MatchOptions { get; set; }
}
public class MatchOption
{
//Match options to respond. null when not configured
public List<string> MatchResponseOptions { get; set; }
}
public class FormKey
{
//form key as configured in action item configuration
public string Name { get; set; }
public bool Mandatory { get; set; }
//indicates whether multiple response are allowed.
public bool Multiple { get; set; }
//List of accepted responses
public List<string> KeyResponses { get; set; }
}
public class DSRFilterOptions
{
//list of domain identifiers as in DSR Configuration
public List<string> Domains { get; set; }
//list of Acts identifiers as in DSR Configuration
public List<string> Acts { get; set; }
//list of requestors identifiers as in DSR Configuration
public List<string> Requestors { get; set; }
//list of Request Types identifiers as in DSR Configuration
public List<string> RequestTypes { get; set; }
}
Submit ActionItem Response
• Description: Used to submit action item response by ID
• Method: POST
• Url: <baseUrl>/DSR/ActionItem/SubmitValidateResponse/{actionItemId}
RequestBody
Type: form-data
Keys:
1. files: <list of attachments>
2. response: <model provided below>
public class ValidateItemResponseV1
{
//Action item comment in response
public string Comment { get; set; }
//response of each form key as provided in pendingactionitem api
public List<ValidateKeyResponse> KeysResponse { get; set; }
//match response from options provided in pendingactionitem api
public string MatchResponse { get; set; }
//List of match not found fields.
public List<string> MatchNotFoundFields { get; set; }
}
public class ValidateKeyResponse
{
public string Name { get; set; }
public string Value { get; set; }
}
Sample Response:
{
“statusCode”: 201
“errorMessage”: “”,
“response”: true
}
Note:
- Please contact Admin for Rest API baseUrl or additional support