REST API - Execute an internal query


GET  /internalqueries

  • This method allows data of a specific reporting in JSON format to be obtained from Product name - ev itsm.png.

Notes

      Open url.png  see Product name - ev itsm.png REST API Conventions 

  • If successful, an HTTP status code 200 is returned and a URL link (HREF) to the resource is provided.

List of parameters / objects

Mandatory parameters

You must use the parameters below in the URL.
 

Parameter Type Description / Example
queryguid string Parent request identifier (GUID)

Note: If you display in Product name - ev itsm.png a report that you want to use with this method, the value of this parameter should be the value of the QUERYID parameter (or QUERYGUID in some cases) in the report's URL. The value to be extracted is between %7B and %7D. Open url.png See the Examples

filterguid string Filter identifier (GUID). If not specified, the Default filter is used.

Note: If you display in Product name - ev itsm.png a report that you want to use with this method, the value of this parameter should be the value of the q2_f in the report's URL. The value to be extracted is between %7B and %7D. Open url.png See the Examples

viewguid string View identifier (GUID). If not specified, the Default view is used.

Note: If you display in Product name - ev itsm.png a report that you want to use with this method, the value of this parameter should be the value of the q2_r in the report's URL. The value to be extracted is between %7B and %7D. Open url.png See the Examples

Optional parameters

You can use the JSON objects detailed below in the HTTP request string.
 

Object Type Description / Example
custom_filter string Supplementary filter, allowing searching a precise record. (See the example next page). Open url.png See Example.
  • The filter needs to be an SQL query and can use the extended Product name - ev itsm.png functions (Example: RTZConvert).
  • To find the SQL syntax of a filter: Proceed to the Filter screen, switch into advanced mode and recopy the SQL query into a text editor.
max_rows integer Maximum number of records which the request must return, to avoid sending too many records

Examples

  • URL for the Execute an internal query methode using queryguid, filterguid, viewguid parameters
https://{your_server}}/api/v1/{your_account}/internalqueries?queryguid=F6AC1BB3-DC03-4E64-BC46-30DEDE3BD27E&filterguid=AAED4F63-76CC-4E09-8C97-2C425D4E48EF&viewguid=DD4F7938-951F-4279-953B-A6EB075FCB35&max_rows=50
  • Report's URL in Product name - ev itsm.png
https://{your_server}/index.php?PHPSESSID=vmpnq9f3n39jjlfjv5curg9mn3&internalurltime=1505123365&theme=%7B8C971D2C-AC44-42AC-86BC-C949A1E1466A%7D&eventName=ViewReport&QUERYID=%7BF6AC1BB3-DC03-4E64-BC46-30DEDE3BD27E%7D&CAPTION=%26lt%3BdynamicTitle%26gt%3BActive+equipment%26lt%3B%2FdynamicTitle%26gt%3B&FILTER_GUID=%7BAAED4F63-76CC-4E09-8C97-2C425D4E48EF%7D&LAYOUT_GUID=%7BDD4F7938-951F-4279-953B-A6EB075FCB35%7D&TASK_GUID=%7B2F4CDDAE-3AAF-4BF4-824A-7E0297E844F0%7D&q2_tree_id=234&q2_level=1&q2_value_selected=TGFzZXI%3D&q2_treetable=2&q2_clickfield=1&clickpage=1&q2_cnt=1&q2_f=%7BAAED4F63-76CC-4E09-8C97-2C425D4E48EF%7D&q2_r=%7BDD4F7938-951F-4279-953B-A6EB075FCB35%7D&OnChangeFilter=false&q2_filter=MjM0%7Cfdc573a242fd004f56d615c38a386195ee90e9a6
  • Application of the additional filter custom_filter  -->  Select only the beneficiary gounod
custom_filter = (UPPER(AM_RECIPIENT.LAST_NAME) like UPPER('%gounod'))

==> Result in JSON format

<dataset recordcount= "-1" sumsofar= "0" identity= "0" previouspage= "0" nextpage= "0">
  <Fieldname _0= "Beneficiary" _1= "SD_REQUEST.SUBMIT_DATE_UT_0" _2= "Topic" _3= "Description" _4= "Incident Number " _5= "Requesting Person" _6= "Status" _7= "Urgency" _8= "SD_REQUEST.MAX_RESOLUTION_1"/>
  <Fieldtype _0= "char" _1= "datetime" _2= "char" _3= "Blob" _4= "char" _5= "char" _6= "char" _7= "char" _8= "datetime"/>
  <row _0= "GOUNOD, FRANCK" _1= "30/05/2008 15:24:06" _2= "Oracle" _3= "" _4= "I080530_000003" _5= "Leblanc, Fred" _6= "In Progress" _7= "2 - Average" _8= "02/06/2008 15:24:06"/>
  <row _0= "GOUNOD, FRANCK" _1= "30/05/2008 15:23:23" _2= "Oracle" _3= "" _4= "I080530_000002" _5= "Leblanc, Fred" _6= "In Progress" _7= "2 - Average" _8= "02/06/2008 15:23:23"/>
  <row _0= "GOUNOD, FRANCK" _1= "27/05/2008 13:17:51" _2= "Oracle" _3= "test nm 02<BR>" _4= "I080527_000001" _5= "Leblanc, Fred" _6= "Incident lie" _7= "2 - Average" _8= "28/05/2008 13:17:51"/>
</dataset>
  • Generation of a filter with extended Product name - ev itsm.png functions
({# FILTER_DATE ('SD_REQUEST.SUBMIT_DATE_UT', 'LASTDAYS', '2') #})

Caution: In this specific case, you must replace the # caracters by %23. Otherwise an error is returned.

({%23 FILTER_DATE ('SD_REQUEST.SUBMIT_DATE_UT', 'LASTDAYS', '2') %23})

HTTP status codes for the method

StatusHeader
Code Error Description
Status200
200 OK (Success) Request processed successfully.
Status401
401 Unauthorized Authentication process for accessing the resource is incorrect: Login/Password incorrect, Invalid session, Incorrect Product name - ev itsm.png account.
Example documentation icon EN.png
{
 "error": "Invalid Login / Password"
}

Examples

Result with a status code 200 returned

{
"HREF": "https://{your_server}/api/v1/{your_account}/internalqueries?queryguid=6938436D-B024-4B9E-9815-A41C1D7C7A0E&filterguid=9194D882-B683-4744-93ED-2625C77DAFED&viewguid=B0103C62-A815-4817-B488-E241C143B366&max_rows=3",
"recordcount": 3,
"previouspage": 0,
"nextpage": 0,
"records": [
{
"Creation Date": "3/14/2008 12:00:00 am",
"Recipient": "Ernst, Walter",
"Incident Number": "040121_017763",
"Category": "Diskette Drive",
"Priority": "2",
"Status": "Reopened",
"Time Status": "4"
},
{
"Creation Date": "6/10/2009 4:16:45 pm",
"Recipient": "User",
"Incident Number": "I090610_000004",
"Category": "Desktop",
"Priority": "2",
"Status": "In progress",
"Time Status": "4"
},
{
"Creation Date": "12/26/2011 1:45:59 pm",
"Recipient": "User",
"Incident Number": "I111226_000002",
"Category": "Desktop",
"Priority": "2",
"Status": "In progress",
"Time Status": "4"
}
]
}


ConventionsAPI

REST API Conventions

Convention Meaning
Orange Parameters used in an HTTP request string (URL) which do not correspond to Product name - ev itsm.png database fields.
Example documentation icon EN.png   Method View a list of assets
https://{your_server}/api/v1/{your_account}/assets?max_rows=3&fields=asset_tag
Black and Bold Parameters used in the URL of an HTTP request which correspond to Product name - ev itsm.png database fields.
Example documentation icon EN.png   Method View an asset
https://{your_server}/api/v1/{your_account}/assets/{asset_id}
Green Parameters used in the body of an HTTP request which represent JSON object names corresponding to Product name - ev itsm.png database fields; they allow the value of a database field to be assigned or modified.
Example documentation icon EN.png   Method Close an incident/request

{  "closed": {  "end_date": "11/20/2016 12:12:12",  }  }
Parameters used in the body of an HTTP request which represent JSON object names not corresponding to Product name - ev itsm.png database fields.
Example documentation icon EN.png   Method Reopen an incident/request

{  "restarted": {  "comment": "string (required)"  }  }

Tags:
Last modified by Unknown User on 2018/10/24 14:51
Created by Administrator XWiki on 2017/04/07 12:04

Shortcuts

Recent Updates

Haven't been here in a while? Here's what changed recently:

-   Product name - ev itsm.png
-   Product name - ev sas.png

Interesting Content

How to Automate Integration
Add a Shortcut to an App
History
Quick Dashboard
Full text search - Stop Words

Powered by XWiki ©, EasyVista 2018