Skip to end of metadata
Go to start of metadata

Certain values used in the REST API can be quite lengthy or overly complicated to use multiple times in an API call. Sisense provides several types of Configuration parameters that you can use to refer to values.  

For example, if you have previously used an access_token through Oauth2 authentication, Sisense stores this value in memory and allows you to recall this value by referring to it as [@access_token].  

There are three types of configuration parameters:

  • In Memory Parameters: These parameters are saved by Sisense In Memory and can be referred in later REST API calls. 

  • Configuration Reference Parameters: These parameters refer to other parameters used in the configuration JSON file.  

  • Result Reference Parameters: These parameters refer to parameters returned after execution. 

In Memory Parameters

In Memory parameters are saved in Sisense memory and can be referenced for future API calls by adding the prefix [@parameter_name] as the value of the parameter. Sisense currently supports the following In Memory parameters:

  • [@accesstoken]: Reference to the credential parameter "access_token" returned as a result of Oauth2 authentication.

  • [@today]: Current date formatted as "yyyy-MM-dd". This In memory parameter can be used with the Days parameter, for example, [@today-1] means yesterday, [@today+30] means the current date plus 30 days ,etc.

  • [@now]: Current time. This parameter can also be modified, for example, [@now - 60] means a minute ago, [@now + 3600] is an hour(3600 seconds) ahead, etc.

  • [@accumulative] Reference to the AccumulativeSettings object. This object determines where an accumulative builds starts. This reference must be included in each table you want support accumulative builds. For more information, see AccumulativeSettings.

Configuration Reference Parameters

Configuration Reference parameters refer to the values of parameters listed in your configuration JSON file. 

For example, the shortcut [@Settings.Provider] refers to the value you defined as the value of Provider in the Settings object. 

Result Reference Parameters

Result Reference parameters refer to data returned after execution in JSON format as a JSON Document. Usually this document contains the results with the data requested represented as a JSON Array and some additional metadata needed for determining if there is more data, or some parameters for the next page.

For example, the Result Reference parameters can refer to: 

 

  • All of the executed data: [@Tables.ActionName.@.]

  • Some data taken from the enitre returned document: [@Tables.Comment.@.next_page]

  • All requested data results as a JSON Array, not transformed with no metadata included: [@Tables.Comment.@.~]

  • All returned records as a single JSON Array with documents already transformed: [@Table.Comment.@.Doc.All]

  • Some value from a transformed document taken by path: [@Table.Comment.@.Doc.via.channel] 


See the examples below for more information. 

Example

In the example below, the data is represented as a "comments" field in the JSON Document with additional fields like "next_page" and some metadata. As "comments" is an array, it can have many records in which each of them is another JSON Document. Sisense can transform these documents' structure. There are options to reference these transformed documents or to return the Action execution results as a single document with only the relevant fields.

Example
{
  "comments": [
    {
      "id": 58740724865,
      "type": "Comment",
      "author_id": 2945367025,
      "body": "Hi Alexey,\n\nEmails, chats, voicemails, and tweets are captured in Zendesk as tickets." 
      "html_body": "Emails, chats, voicemails, and tweets are captured in Zendesk as tickets." 
      "attachments": [],
      "audit_id": 58740724805,
      "via": {
        "channel": "sample_ticket",
        "source": {
          "from": {},
          "to": {},
          "rel": null
        }
      },
      "created_at": "2016-06-01T14:53:45Z",
      "metadata": {
        "system": {},
        "custom": {}
      }
    }
  ],
  "next_page": "http://host/nextPageUri",
  "previous_page": null,
  "count": 1
}

 

Example

 The example below can be the result of Credentials.Auth Action execution. This kind of Action is executed only once and all results are cached.

 

Example
{
    "access_token" : "someaccesstoken",
    "refresh_token" : "somerefreshtoken",
    "expire_at": 1234567,
    "token_type": "token"
}


Example

 
 The following is a full example of a Native REST Connector API call: 

 

Example
{
  "Settings": {
    "Provider": "rest-marketo",  
	"ConnectorAssemblyFileName": "_rest.tag".
    "FileList":  [   
           "config.json", "oauth2Config.json" 
         ],  
    "MaxDocs": 500,
    "FetchSize": 1000,
    "Parameters": {
      "uri": "https://601-OXE-081.mktorest.com"
    }
  },
  "Credentials": {
    "Auth": {
      "Name": "OAuth2",
      "Public": "False",
      "Schema": "Https",
      "Method": "GET",
      "Base": "[@Settings.Parameters.uri]",
      "Path": "identity/oauth/token",
      "Headers": {},
      "PathParameters": [],
      "QueryParameters": {
        "grant_type": "client_credentials",
        "client_id": "e34543aa-1238-4335-b991-ad0434a9d1",
        "client_secret": "qyiv50xbfdg435kmG454z9up9M"
      },
      "Body": {}
    }
  },
  "Tables": [
    {
      "Name": "PagingToken",
      "Public": "false",
      "Schema": "Https",
      "Method": "GET",
      "Base": "https://601-oxe-081.mktorest.com",
      "Path": "rest/v1/activities/pagingtoken.json",
      "QueryParameters": {
        "access_token": "[@Credentials.Auth.@~Doc.access_token]",
        "sinceDatetime": "2015-05-1",
        "_method": "GET"
      },
      "Body": {}
    },
    {
      "Name": "Activities",
      "Schema": "Https",
      "Public": "true",
      "Method": "GET",
      "Base": "[@Settings.Parameters.uri]",
      "Path": "rest/v1/activities.json",
      "QueryParameters": {
        "access_token": "[@Credentials.Auth.@~Doc.access_token]",
        "nextPageToken": "[@Tables.PagingToken.@~Doc.nextPageToken]",
        "listId": "17383"
      },
      "ArrayQueryParameters": { "activityTypeIds": [ "1", "3", "40", "41", "7", "47", "11" ] },
      "PagingConfig": {
        "Type": "URL",
        "KeepUrl": "true",
        "NextToken": "[@Tables.Activities.@.nextPageToken]",
        "QueryParameters": {
          "nextPageToken": "[@Tables.Activities.@.nextPageToken]"
        }
      },
      "Body": {},
      "DataPath": "result"
    }
  ]
}


  • No labels