/components/grids/{gridComponentId}Returns paginated data for a Grid component.
Grid components support:
- Pagination
- Multi-column sorting
- Column filtering
The Client API is expected to perform server-side pagination, sorting, and filtering.
Request
Path parameters
The Grid component ID.
Query parameters
The reference ID identifying the external account or entity.
The resource ID.
Language identifier.
Locale identifier.
Current page number.
1 · min: 1Number of items per page.
10 · min: 1Sorting expression.
Examples:
- sort=id
- sort=-id
- sort=id,-title
Prefixing a column with "-" sorts descending.
id,-titleEqual operator example.
id is 5. eq(id)=5 or id=5Contains operator example.
Does not contain operator example.
Is not null operator example.
In-array operator example.
active,pendingRequest example
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.client.com/components/grids/{gridComponentId}");
request.Headers.Add("Accept", "application/json");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());var options = new RestClientOptions("")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("https://api.client.com/components/grids/{gridComponentId}", Method.Get);
request.AddHeader("Accept", "application/json");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);curl -L -X GET "https://api.client.com/components/grids/{gridComponentId}" \
-H "Accept: application/json"var headers = {
'Accept': 'application/json'
};
var dio = Dio();
var response = await dio.request(
'https://api.client.com/components/grids/{gridComponentId}',
options: Options(
method: 'GET',
headers: headers,
),
);
if (response.statusCode == 200) {
print(json.encode(response.data));
}
else {
print(response.statusMessage);
}var headers = {
'Accept': 'application/json'
};
var request = http.Request('GET', Uri.parse('https://api.client.com/components/grids/{gridComponentId}'));
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.client.com/components/grids/{gridComponentId}"
method := "GET"
client := &http.Client{}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Accept", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}GET /components/grids/{gridComponentId} HTTP/1.1
Host: api.client.com
Accept: application/jsonOkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://api.client.com/components/grids/{gridComponentId}")
.method("GET", null)
.addHeader("Accept", "application/json")
.build();
Response response = client.newCall(request).execute();Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("https://api.client.com/components/grids/{gridComponentId}")
.header("Accept", "application/json")
.asString();const myHeaders = new Headers();
myHeaders.append("Accept", "application/json");
const requestOptions = {
method: "GET",
headers: myHeaders,
redirect: "follow"
};
fetch("https://api.client.com/components/grids/{gridComponentId}", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));var settings = {
"url": "https://api.client.com/components/grids/{gridComponentId}",
"method": "GET",
"timeout": 0,
"headers": {
"Accept": "application/json"
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.client.com/components/grids/{gridComponentId}");
xhr.setRequestHeader("Accept", "application/json");
xhr.send();val client = OkHttpClient()
val request = Request.Builder()
.url("https://api.client.com/components/grids/{gridComponentId}")
.get()
.addHeader("Accept", "application/json")
.build()
val response = client.newCall(request).execute()#include <stdio.h>
#include <curl/curl.h>
int main(void) {
CURL *curl = curl_easy_init();
if (curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(curl, CURLOPT_URL, "https://api.client.com/components/grids/{gridComponentId}");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept: application/json");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
CURLcode res = curl_easy_perform(curl);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
}
return 0;
}const axios = require('axios');
let config = {
method: 'get',
maxBodyLength: Infinity,
url: 'https://api.client.com/components/grids/{gridComponentId}',
headers: {
'Accept': 'application/json'
}
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});const https = require('follow-redirects').https;
const fs = require('fs');
let options = {
'method': 'GET',
'hostname': 'api.client.com',
'path': '/components/grids/{gridComponentId}',
'headers': {
'Accept': 'application/json'
},
'maxRedirects': 20
};
const req = https.request(options, function (res) {
let chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
let body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
req.end();#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.client.com/components/grids/{gridComponentId}"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"Accept": @"application/json"
};
[request setAllHTTPHeaderFields:headers];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
dispatch_semaphore_signal(sema);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);open Lwt
open Cohttp
open Cohttp_lwt_unix
let reqBody =
let uri = Uri.of_string "https://api.client.com/components/grids/{gridComponentId}" in
let headers = Header.init ()
|> fun h -> Header.add h "Accept" "application/json"
in
Client.call ~headers `GET uri >>= fun (_resp, body) ->
body |> Cohttp_lwt.Body.to_string >|= fun body -> body
let () =
let respBody = Lwt_main.run reqBody in
print_endline (respBody)<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.client.com/components/grids/{gridComponentId}',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Accept: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
<?php
$client = new Client();
$headers = [
'Accept' => 'application/json'
];
$request = new Request('GET', 'https://api.client.com/components/grids/{gridComponentId}', $headers);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Accept", "application/json")
$response = Invoke-RestMethod "https://api.client.com/components/grids/{gridComponentId}" -Method 'GET' -Headers $headers
$response | ConvertTo-Jsonimport requests
import json
url = "https://api.client.com/components/grids/{gridComponentId}"
payload = {}
headers = {
"Accept": "application/json"
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)import http.client
import json
conn = http.client.HTTPSConnection("api.client.com")
payload = ''
headers = {
"Accept": "application/json"
}
conn.request("GET", "/components/grids/{gridComponentId}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))library(httr)
headers = c(
'Accept' = 'application/json'
)
res <- VERB("GET", url = "https://api.client.com/components/grids/{gridComponentId}", add_headers(headers))
cat(content(res, 'text'))require "uri"
require "json"
require "net/http"
url = URI("https://api.client.com/components/grids/{gridComponentId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
response = https.request(request)
puts response.read_body
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = reqwest::Client::builder()
.build()?;
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("Accept", "application/json".parse()?);
let request = client.request(reqwest::Method::from_bytes(b"GET")?, "https://api.client.com/components/grids/{gridComponentId}")
.headers(headers);
let response = request.send().await?;
let body = response.text().await?;
println!("{}", body);
Ok(())
}http --follow --timeout 3600 GET "https://api.client.com/components/grids/{gridComponentId}" \
'Accept':'application/json'wget --no-check-certificate --quiet \
--method GET \
--timeout=0 \
--header 'Accept: application/json' \
'https://api.client.com/components/grids/{gridComponentId}'var request = URLRequest(url: URL(string: "https://api.client.com/components/grids/{gridComponentId}")!,timeoutInterval: Double.infinity)
request.addValue("application/json", forHTTPHeaderField: "Accept")
request.httpMethod = "GET"
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
}
task.resume()Responses
- 200
Grid component data.
Array of GridData objects.
Show child attributes
Invoice ID.
3275Invoice URL.
https://SMS.es.comInvoice date.
2018-01-23Invoice date and time.
2018-01-23T09:40:16ZShow child attributes
Show child attributes
Total number of rows.
22Number of rows in the current page.
10Maximum rows per page.
10Current page number.
1Total number of pages.
3Show child attributes
Link to the first page.
/components/grids/invoices?page_number=1Link to the last page.
/components/grids/invoices?page_number=3Link to the previous page.
NoneLink to the next page.
/components/grids/invoices?page_number=2{
"data": [
{
"id": 3275,
"url": "https://SMS.es.com",
"invoiceDate": "2018-01-23",
"invoiceDateTime": "2018-01-23T09:40:16Z"
}
],
"meta": {
"pagination": {
"total": 22,
"count": 10,
"per_page": 10,
"current_page": 1,
"total_pages": 3,
"links": {
"first": "/components/grids/invoices?page_number=1",
"last": "/components/grids/invoices?page_number=3",
"prev": null,
"next": "/components/grids/invoices?page_number=2"
}
}
}
}