# Get a sync status

URL: https://docs.sparklayer.io/developers/api/sync-log/get-sync-logging-status
Operation: `GET /api/v1/sync-log/{integration}/{data_type}` (operationId `getLoggingStatus`)
OpenAPI spec: https://docs.sparklayer.io/openapi/sync-log.yaml

Returns the sync timestamps and the number of logged errors for the integration and data type. Returns `404` if no full sync has been recorded for them yet.

`GET /api/v1/sync-log/{integration}/{data_type}`

**Base URLs:** `https://app.sparklayer.io` (Live), `https://test.app.sparklayer.io` (Test)

**Authentication:** send `Authorization: Bearer <access_token>` and `Site-Id: <site id>` with every request. Get the token from [Get an access token](https://docs.sparklayer.io/developers/api/core/get-an-access-token.md); see [Authentication](https://docs.sparklayer.io/developers/authentication.md).

### Example request

```bash
curl "https://app.sparklayer.io/api/v1/sync-log/shopify/products" \
  -H "Authorization: Bearer $SPARKLAYER_TOKEN" \
  -H "Site-Id: $SPARKLAYER_SITE_ID"
```

Set `SPARKLAYER_TOKEN` to an access token and `SPARKLAYER_SITE_ID` to your Site ID. For the test environment, use `https://test.app.sparklayer.io`.

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `integration` | string | Yes | The integration the sync log belongs to, such as `shopify`. Logs are kept separately for each integration and data type. Example: `shopify` |
| `data_type` | "products" \| "customers" \| "merchant" \| "purchases" \| "pricing" \| "accountancy" | Yes | The type of data the sync log is for. Example: `products` |

### Header parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Site-Id` | string | Yes | Your SparkLayer Site ID, from Settings > API in the SparkLayer Dashboard. Example: `jones-climbing` |

### Responses

#### 200: The sync timestamps and the number of logged errors.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `started_full_sync` | string (date-time) | | Started full sync |
| `last_full_sync` | string (date-time) | | Last full sync |
| `last_full_sync_succeeded` | boolean | | Was the last full sync successful? A successful sync may still have logging errors. A failed full sync may indicate integration configuration issues or timeout. |
| `last_partial_sync` | string (date-time) | | |
| `error_count` | integer | | Sync errors count |

```json
{
  "started_full_sync": "2023-01-01T01:01:01Z",
  "last_full_sync": "2023-01-01T01:01:01Z",
  "last_full_sync_succeeded": true,
  "last_partial_sync": "2023-01-01T01:01:01Z",
  "error_count": 3
}
```

#### Other statuses: An error. The body describes the problem: see [Errors](https://docs.sparklayer.io/developers/errors.md).

`application/problem+json`: the standard error body (below).

### Error body

Error responses with a body use this RFC 7807 problem details object. See [Errors](https://docs.sparklayer.io/developers/errors.md) for every status code and which errors to retry.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `detail` | string | | Human-readable summary of the error |
| `status` | integer | | HTTP Status code returned from API |
| `title` | string | | Machine-readable error code |
| `type` | string | | |

```json
{
  "detail": "Data Validation Failed",
  "status": 400,
  "title": "invalid-api-request-contents",
  "type": "https://hub.sparklayer.io/tech-docs"
}
```
