Filter port log
POST
/ports/{id}/log
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");curl_easy_setopt(hnd, CURLOPT_URL, "https://api.ltesocks.io/v2/ports/example/log");
struct curl_slist *headers = NULL;headers = curl_slist_append(headers, "Authorization: Bearer <token>");headers = curl_slist_append(headers, "Content-Type: application/json");curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{ \"from\": \"2022-04-02T00:40:44\", \"to\": \"2022-04-02T00:40:44\", \"page\": 1, \"pageSize\": 20 }");
CURLcode ret = curl_easy_perform(hnd);using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://api.ltesocks.io/v2/ports/example/log"), Headers = { { "Authorization", "Bearer <token>" }, }, Content = new StringContent("{ \"from\": \"2022-04-02T00:40:44\", \"to\": \"2022-04-02T00:40:44\", \"page\": 1, \"pageSize\": 20 }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://api.ltesocks.io/v2/ports/example/log"
payload := strings.NewReader("{ \"from\": \"2022-04-02T00:40:44\", \"to\": \"2022-04-02T00:40:44\", \"page\": 1, \"pageSize\": 20 }")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>") req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api.ltesocks.io/v2/ports/example/log")) .header("Authorization", "Bearer <token>") .header("Content-Type", "application/json") .method("POST", HttpRequest.BodyPublishers.ofString("{ \"from\": \"2022-04-02T00:40:44\", \"to\": \"2022-04-02T00:40:44\", \"page\": 1, \"pageSize\": 20 }")) .build();HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");RequestBody body = RequestBody.create(mediaType, "{ \"from\": \"2022-04-02T00:40:44\", \"to\": \"2022-04-02T00:40:44\", \"page\": 1, \"pageSize\": 20 }");Request request = new Request.Builder() .url("https://api.ltesocks.io/v2/ports/example/log") .post(body) .addHeader("Authorization", "Bearer <token>") .addHeader("Content-Type", "application/json") .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = { method: 'POST', url: 'https://api.ltesocks.io/v2/ports/example/log', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, data: {from: '2022-04-02T00:40:44', to: '2022-04-02T00:40:44', page: 1, pageSize: 20}};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://api.ltesocks.io/v2/ports/example/log';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"from":"2022-04-02T00:40:44","to":"2022-04-02T00:40:44","page":1,"pageSize":20}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")val body = RequestBody.create(mediaType, "{ \"from\": \"2022-04-02T00:40:44\", \"to\": \"2022-04-02T00:40:44\", \"page\": 1, \"pageSize\": 20 }")val request = Request.Builder() .url("https://api.ltesocks.io/v2/ports/example/log") .post(body) .addHeader("Authorization", "Bearer <token>") .addHeader("Content-Type", "application/json") .build()
val response = client.newCall(request).execute()use serde_json::json;use reqwest;
#[tokio::main]pub async fn main() { let url = "https://api.ltesocks.io/v2/ports/example/log";
let payload = json!({ "from": "2022-04-02T00:40:44", "to": "2022-04-02T00:40:44", "page": 1, "pageSize": 20 });
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap());
let client = reqwest::Client::new(); let response = client.post(url) .headers(headers) .json(&payload) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request POST \ --url https://api.ltesocks.io/v2/ports/example/log \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "from": "2022-04-02T00:40:44", "to": "2022-04-02T00:40:44", "page": 1, "pageSize": 20 }'wget --quiet \ --method POST \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --body-data '{ "from": "2022-04-02T00:40:44", "to": "2022-04-02T00:40:44", "page": 1, "pageSize": 20 }' \ --output-document \ - https://api.ltesocks.io/v2/ports/example/logReturns port events for a requested time range with pagination.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Account-scoped port identifier.
Request Bodyrequired
Section titled “Request Bodyrequired”Pagination parameters
Media typeapplication/json
object
from
string format: date-time
Example
2022-04-02T00:40:44to
string format: date-time
Example
2022-04-02T00:40:44page
integer
Example
1pageSize
integer
Example
20Responses
Section titled “Responses”Successful operation
Media typeapplication/json
object
data
Array<object>
object
action
string
cause
string
source
string
extra
string
createdAt
string format: date-time
page
integer
pageSize
integer
total
integer
Example
{ "data": [ { "action": "update", "cause": "admin", "source": "adminDashboard", "extra": "extra info", "createdAt": "2022-04-03T01:13:50.182Z" } ], "page": 1, "pageSize": 20, "total": 7}The bearer token is missing, invalid, or no longer active.
Media typeapplication/json
object
error
Error text representation
string
Example
{ "error": "example error"}The configured request limit has been exceeded.
Media typeapplication/json
object
error
Error text representation
string
Example
{ "error": "example error"}Error
Media typeapplication/json
object
error
Error text representation
string
Example
{ "error": "example error"}