Introduction to MADE Query API
This documentation introduces users to the MADE Query API that allows them to view information assigned to various data tables. Users will be instructed on how to format requests and page through large result sets using the *range parameter.
See the Authentication documentation for information on how to obtain the authentication headers within the request.
Use cases
- Count the number of specified items in a table.
- List specified items.
Supported parameters
| Parameter | Required | Definition |
|---|---|---|
dataSource | Yes | Must be set to dice. |
*view | Yes | Determines the table whose rows you will be obtaining. |
*limit | Yes | Determines the number of rows the request will return. |
*range | No | Used to page through large result sets. Instructions for how to use this parameter can be found below. |
Example request
curl --request GET \
--url 'https://example.securemcloud.com/rest/rest.php?dataSource=dice&*view=alsubscr&*limit=1' \
--header 'accept: application/json' \
--header 'content-type: multipart/form-data' \
--header 'X-DICE-APPKEY: {{X-DICE-APPKEY}}' \
--header 'X-DICE-USERNAME: {{X-DICE-USERNAME}}' \
--header 'X-DICE-DATE: {{X-DICE-DATE}}' \
--header 'X-DICE-NONCE: {{X-DICE-NONCE}}' \
--header 'X-DICE-DIGEST: {{X-DICE-DIGEST}}' \
Example response
{
"ALSUBSCR": [
{
"ACCOUNT_NUMBER": " 2",
"COMPANY_NAME": "TEST ACCT",
"SORT_BY_NAME": "TEST",
"STREET_NO": "301",
"STREET_NAME1": "E",
"STREET_NAME2": "COMMERCIAL DR BLDG#A1111",
"CITY": "BAY CITY",
"STATE": "MI",
"COUNTRY": "USA",
"ZIPCODE": "48708",
"IDENTIFIER_1": "BURG",
"IDENTIFIER_2": "TESTING",
"ANY_SIG_TEST": "Z",
"LAST_SIG_TYPE": "NOTIFY",
"LAST_SIG_WHEN": "739008.55961",
"ACTIVITY_DATE": "734760",
"ACTIVATE": "Y",
"DEALER": " ME",
"TIME_ZN": "EST",
"TEST_SPAN": "N",
"LAST_REVISION": "739681.35711",
"REVISION_OPR": "NW",
"ZONE_WILDCARDS": "N",
"START_DATE": "11/23/14",
"MAP": "MAP",
"REGIONX": "REGX",
"REGIONY": "REGY",
"EXTENDED_SIGNALS": "N",
"RADIO_LINK": "NW0000000",
"ZONES_LINKED": "C",
"USE_AREA": "Y",
"TWO_WAY": "N",
"PASSCODE_NEEDED": "Y",
"SUPERVISE_SCHEDULE": "Y",
"STORM_MODE": "N",
"TRACK_GROUPING": "ANDY",
"I_BRANCH": "PRO",
"M_BRANCH": "XXZ",
"B_BRANCH": "PRO",
"S_BRANCH": "PRO",
"JOB_TYPE": "2-RSHP",
"BLANKET_PO_NUMBER": "KEYWRITER",
"CATCH_LATETO_ALARMS": "Y",
"EE_DELAY": "Y",
"LAST_TEST_DATE": "739008.53793",
"BILLING_STATUS": "R",
"NTD_START_DATE": "735562",
"COMMERCIAL_RESIDENTL": "C",
"CONTACT_LIST_BY_AREA": "Y",
"GLOBAL_CHART_LIST": " ULSIA",
"LATITUDE": "43.559572000",
"LONGITUDE": "-83.820876000",
"COUNTY": "BAY",
"VOICE_IMMUNE": "Y",
"STORE_PASSCODE_PRINT": "N",
"GENERATE_SIG_ON_TEST": "N",
"CUSTOM_ACCOUNT": "N",
"FORCED_NOTES": "N"
}
],
"totalRecords": 1
}
Establishing a range
The *range parameter is used to page through large requests. Prior to running the range request(s), users must first define what *limit to use and the table’s primary key field.
The primary key determines what the system will use to page through the table. See the View Table Schema documentation for information on obtaining a table’s primary key.
Once a limit and primary key are determined, users can run a sequence of requests to page through the table’s data.
Example requests
- The first request establishes the table and how it will be paged.
- This request will page through the Subscriber Record (
ALSUBSCR) table 1000 accounts at a time as the table’s primary key is the Account Number field.
- This request will page through the Subscriber Record (
curl --request GET \
--url 'https://example.securemcloud.com/rest/rest.php?dataSource=dice&*view=alsubscr&*limit=1000&*range=account_number' \
--header 'accept: application/json' \
--header 'content-type: multipart/form-data' \
--header 'X-DICE-APPKEY: {{X-DICE-APPKEY}}' \
--header 'X-DICE-USERNAME: {{X-DICE-USERNAME}}' \
--header 'X-DICE-DATE: {{X-DICE-DATE}}' \
--header 'X-DICE-NONCE: {{X-DICE-NONCE}}' \
--header 'X-DICE-DIGEST: {{X-DICE-DIGEST}}' \
- The second (and each subsequent) request defines the last row of the previous request, so the system knows where to begin the next page of information.
- Please note: the requests following the first will contain the last row of the previous request along with the following 999 rows. If applicable, users may want to have their program discard the extraneous duplicate row.
curl --request GET \
--url 'https://example.securemcloud.com/rest/rest.php?dataSource=dice&*view=alsubscr&*limit=1000&*range=account_number&account_number= 91' \
--header 'accept: application/json' \
--header 'content-type: multipart/form-data' \
--header 'X-DICE-APPKEY: {{X-DICE-APPKEY}}' \
--header 'X-DICE-USERNAME: {{X-DICE-USERNAME}}' \
--header 'X-DICE-DATE: {{X-DICE-DATE}}' \
--header 'X-DICE-NONCE: {{X-DICE-NONCE}}' \
--header 'X-DICE-DIGEST: {{X-DICE-DIGEST}}' \
- Continue running requests in this manner until the request returns fewer than the defined limit. Once fewer rows are returned than what was requested, users have reached the end of the table’s contents.