# List execution logs

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://apidocs.cata.sg/pos-integration-service-api/api/v-1/schedules/schedule-id/logs/llms.txt.
> For full documentation content, see https://apidocs.cata.sg/pos-integration-service-api/api/v-1/schedules/schedule-id/logs/llms-full.txt.

GET http://localhost:8080/api/v1/schedules/{scheduleId}/logs

Paginated list of execution logs for a schedule.

Reference: https://apidocs.cata.sg/pos-integration-service-api/api/v-1/schedules/schedule-id/logs/list-execution-logs

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /api/v1/schedules/{scheduleId}/logs:
    get:
      operationId: list-execution-logs
      summary: List execution logs
      description: Paginated list of execution logs for a schedule.
      tags:
        - >-
          subpackage_api.subpackage_api/v1.subpackage_api/v1/schedules.subpackage_api/v1/schedules/scheduleId.subpackage_api/v1/schedules/scheduleId/logs
      parameters:
        - name: scheduleId
          in: path
          required: true
          schema:
            type: string
        - name: limit
          in: query
          required: false
          schema:
            type: integer
        - name: offset
          in: query
          required: false
          schema:
            type: integer
        - name: X-Api-Key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/api_v1_schedules_{scheduleId}_logs_List
                  execution logs_Response_200
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/GetApiV1SchedulesScheduleidLogsRequestNotFoundError
servers:
  - url: http://localhost:8080
components:
  schemas:
    ApiV1SchedulesScheduleIdLogsGetResponsesContentApplicationJsonSchemaLogsItems:
      type: object
      properties:
        id:
          type: integer
        scheduleId:
          type: integer
        status:
          type: string
        startedAt:
          type: string
          format: date-time
        finishedAt:
          type: string
          format: date-time
        errorMessage:
          type: string
        resultsJson:
          type: string
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - scheduleId
        - status
        - startedAt
        - finishedAt
        - errorMessage
        - resultsJson
        - createdAt
      title: >-
        ApiV1SchedulesScheduleIdLogsGetResponsesContentApplicationJsonSchemaLogsItems
    api_v1_schedules_{scheduleId}_logs_List execution logs_Response_200:
      type: object
      properties:
        code:
          type: integer
        isSuccess:
          type: boolean
        message:
          type: string
        logs:
          type: array
          items:
            $ref: >-
              #/components/schemas/ApiV1SchedulesScheduleIdLogsGetResponsesContentApplicationJsonSchemaLogsItems
        total:
          type: integer
        limit:
          type: integer
        offset:
          type: integer
      required:
        - code
        - isSuccess
        - message
        - logs
        - total
        - limit
        - offset
      title: api_v1_schedules_{scheduleId}_logs_List execution logs_Response_200
    ApiV1SchedulesScheduleIdLogsGetResponsesContentApplicationJsonSchemaError:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
        details:
          type: string
        field:
          type: string
      required:
        - code
        - message
        - details
        - field
      title: >-
        ApiV1SchedulesScheduleIdLogsGetResponsesContentApplicationJsonSchemaError
    GetApiV1SchedulesScheduleidLogsRequestNotFoundError:
      type: object
      properties:
        error:
          $ref: >-
            #/components/schemas/ApiV1SchedulesScheduleIdLogsGetResponsesContentApplicationJsonSchemaError
      required:
        - error
      title: GetApiV1SchedulesScheduleidLogsRequestNotFoundError
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

```

## SDK Code Examples

```python api_v1_schedules_{scheduleId}_logs_List execution logs_example
import requests

url = "http://localhost:8080/api/v1/schedules/1514/logs"

querystring = {"limit":"20","offset":"0"}

headers = {"X-Api-Key": "<apiKey>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript api_v1_schedules_{scheduleId}_logs_List execution logs_example
const url = 'http://localhost:8080/api/v1/schedules/1514/logs?limit=20&offset=0';
const options = {method: 'GET', headers: {'X-Api-Key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go api_v1_schedules_{scheduleId}_logs_List execution logs_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:8080/api/v1/schedules/1514/logs?limit=20&offset=0"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-Api-Key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby api_v1_schedules_{scheduleId}_logs_List execution logs_example
require 'uri'
require 'net/http'

url = URI("http://localhost:8080/api/v1/schedules/1514/logs?limit=20&offset=0")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java api_v1_schedules_{scheduleId}_logs_List execution logs_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("http://localhost:8080/api/v1/schedules/1514/logs?limit=20&offset=0")
  .header("X-Api-Key", "<apiKey>")
  .asString();
```

```php api_v1_schedules_{scheduleId}_logs_List execution logs_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'http://localhost:8080/api/v1/schedules/1514/logs?limit=20&offset=0', [
  'headers' => [
    'X-Api-Key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp api_v1_schedules_{scheduleId}_logs_List execution logs_example
using RestSharp;

var client = new RestClient("http://localhost:8080/api/v1/schedules/1514/logs?limit=20&offset=0");
var request = new RestRequest(Method.GET);
request.AddHeader("X-Api-Key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift api_v1_schedules_{scheduleId}_logs_List execution logs_example
import Foundation

let headers = ["X-Api-Key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8080/api/v1/schedules/1514/logs?limit=20&offset=0")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```