# Fetch a category queue by ID

GET https://services.leadconnectorhq.com/social-media-posting/category/queues/{queueId}

Retrieves the details of a single category queue by its unique ID. The response includes a count of posts within the queue that have errors.

## Authentication

Send `Authorization: Bearer <token>` using:

- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `socialplanner/category.readonly`

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | API Version |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `queueId` | string | Yes | Category queue ID |

### Query Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `locationId` | string | Yes | Location ID |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "LeadConnector API",
    "version": "v3"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/social-media-posting/category/queues/{queueId}": {
      "get": {
        "summary": "Fetch a category queue by ID",
        "operationId": "fetchACategoryQueueById",
        "description": "Retrieves the details of a single category queue by its unique ID. The response includes a count of posts within the queue that have errors.",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "v3"
              ]
            }
          },
          {
            "name": "queueId",
            "required": true,
            "in": "path",
            "description": "Category queue ID",
            "schema": {
              "example": "507f1f77bcf86cd799439011",
              "type": "string"
            }
          },
          {
            "name": "locationId",
            "required": true,
            "in": "query",
            "description": "Location ID",
            "schema": {
              "example": "609e126a1c4ae1001291e1b5",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved the category queue.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WrappedFetchQueueByIdResponseDTO"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestDTO"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedDTO"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnprocessableDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [
              "socialplanner/category.readonly"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.",
        "type": "http"
      },
      "Agency-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "WrappedFetchQueueByIdResponseDTO": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "Success or Failure",
            "example": true
          },
          "statusCode": {
            "type": "number",
            "description": "Status Code",
            "example": 200
          },
          "results": {
            "description": "Response payload",
            "example": {
              "message": "Queue fetched successfully",
              "queue": {
                "_id": "60af88475f1b2c001f5d5f4b",
                "locationId": "location-123",
                "categoryId": "6756f381be2553245b08d30c",
                "timeSlots": [
                  {
                    "_id": "65f1a4e1b1d7f0b8d5a7d6a5",
                    "dayOfWeek": 1,
                    "time": "10:00"
                  }
                ],
                "enableFuturePosts": false,
                "prioritizeNewContent": false,
                "status": "active",
                "startDate": "2023-01-01T12:00:00Z",
                "totalPosts": 10,
                "lastScheduledTime": "2023-01-01T12:00:00Z",
                "createdBy": "user-123",
                "createdAt": "2023-01-01T00:00:00Z",
                "updatedAt": "2023-01-01T00:00:00Z",
                "category": {
                  "_id": "6756f381be2553245b08d30c",
                  "name": "Category Name",
                  "primaryColor": "#FFFFFF",
                  "secondaryColor": "#000000",
                  "deleted": false,
                  "locationId": "fvg1TXIiVxGcdOaL0riG",
                  "createdBy": "SQ6d63Va2PUbWEZ9k0TD",
                  "createdAt": "2024-12-09T13:41:21.385Z",
                  "updatedAt": "2024-12-09T13:41:21.385Z"
                }
              }
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "message": {
                    "type": "string",
                    "example": "Queue fetched successfully",
                    "description": "Message"
                  },
                  "queue": {
                    "description": "The fetched queue along with its category metadata.",
                    "example": {
                      "_id": "60af88475f1b2c001f5d5f4b",
                      "locationId": "location-123",
                      "categoryId": "6756f381be2553245b08d30c",
                      "timeSlots": [
                        {
                          "_id": "65f1a4e1b1d7f0b8d5a7d6a5",
                          "dayOfWeek": 1,
                          "time": "10:00"
                        }
                      ],
                      "enableFuturePosts": false,
                      "prioritizeNewContent": false,
                      "status": "active",
                      "startDate": "2023-01-01T12:00:00Z",
                      "totalPosts": 10,
                      "lastScheduledTime": "2023-01-01T12:00:00Z",
                      "createdBy": "user-123",
                      "createdAt": "2023-01-01T00:00:00Z",
                      "updatedAt": "2023-01-01T00:00:00Z",
                      "category": {
                        "_id": "6756f381be2553245b08d30c",
                        "name": "Category Name",
                        "primaryColor": "#FFFFFF",
                        "secondaryColor": "#000000",
                        "deleted": false,
                        "locationId": "fvg1TXIiVxGcdOaL0riG",
                        "createdBy": "SQ6d63Va2PUbWEZ9k0TD",
                        "createdAt": "2024-12-09T13:41:21.385Z",
                        "updatedAt": "2024-12-09T13:41:21.385Z"
                      }
                    },
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "_id": {
                            "type": "string",
                            "example": "60af88475f1b2c001f5d5f4b",
                            "description": "Queue ID"
                          },
                          "locationId": {
                            "type": "string",
                            "example": "location-123",
                            "description": "Location ID"
                          },
                          "categoryId": {
                            "type": "string",
                            "example": "60af88475f1b2c001f5d5f4b",
                            "description": "Category ID"
                          },
                          "timeSlots": {
                            "description": "Time slots for scheduling posts",
                            "example": [
                              {
                                "_id": "65f1a4e1b1d7f0b8d5a7d6a5",
                                "dayOfWeek": 1,
                                "time": "10:00"
                              }
                            ],
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "dayOfWeek": {
                                  "type": "number",
                                  "description": "Day of the week (0-6)",
                                  "example": 0
                                },
                                "time": {
                                  "type": "string",
                                  "description": "Time in HH:mm format",
                                  "example": "09:00"
                                }
                              },
                              "required": [
                                "dayOfWeek",
                                "time"
                              ],
                              "title": "TimeSlotDTO"
                            }
                          },
                          "enableFuturePosts": {
                            "type": "boolean",
                            "example": false,
                            "description": "Enable posting future content"
                          },
                          "prioritizeNewContent": {
                            "type": "boolean",
                            "example": false,
                            "description": "Prioritize new content over older content"
                          },
                          "currentOrder": {
                            "type": "number",
                            "example": 1000,
                            "description": "Current order number in the queue"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "paused",
                              "draft"
                            ],
                            "example": "active",
                            "description": "Status of the queue. Possible values: active, paused, draft."
                          },
                          "startDate": {
                            "format": "date-time",
                            "type": "string",
                            "example": "2023-01-01T12:00:00Z",
                            "description": "Start date of the queue"
                          },
                          "skipDateTime": {
                            "example": [
                              "2023-01-02T12:00:00Z"
                            ],
                            "description": "Dates/times to skip posting",
                            "type": "array",
                            "items": {
                              "format": "date-time",
                              "type": "string"
                            }
                          },
                          "currentPostId": {
                            "type": "string",
                            "example": "60af88475f1b2c001f5d5f4b",
                            "description": "ID of the currently scheduled post",
                            "nullable": true
                          },
                          "totalPosts": {
                            "type": "number",
                            "example": 10,
                            "description": "Total number of posts in the queue"
                          },
                          "lastScheduledTime": {
                            "format": "date-time",
                            "type": "string",
                            "example": "2023-01-01T12:00:00Z",
                            "description": "Timestamp of the last scheduled post",
                            "nullable": true
                          },
                          "createdBy": {
                            "type": "string",
                            "example": "user-123",
                            "description": "ID of the user who created the queue"
                          },
                          "createdAt": {
                            "format": "date-time",
                            "type": "string",
                            "example": "2023-01-01T00:00:00Z",
                            "description": "Creation timestamp"
                          },
                          "updatedAt": {
                            "format": "date-time",
                            "type": "string",
                            "example": "2023-01-01T00:00:00Z",
                            "description": "Last update timestamp"
                          },
                          "category": {
                            "description": "The category associated with the queue.",
                            "example": {
                              "_id": "6756f381be2553245b08d30c",
                              "name": "Category Name",
                              "primaryColor": "#FFFFFF",
                              "secondaryColor": "#000000",
                              "deleted": false,
                              "locationId": "fvg1TXIiVxGcdOaL0riG",
                              "createdBy": "SQ6d63Va2PUbWEZ9k0TD",
                              "createdAt": "2024-12-09T13:41:21.385Z",
                              "updatedAt": "2024-12-09T13:41:21.385Z"
                            },
                            "allOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "_id": {
                                    "type": "string",
                                    "example": "6756f381be2553245b08d30c",
                                    "description": "Category ID"
                                  },
                                  "name": {
                                    "type": "string",
                                    "example": "Category Name",
                                    "description": "Name of the category"
                                  },
                                  "primaryColor": {
                                    "type": "string",
                                    "example": "#FFFFFF",
                                    "description": "Primary color of the category"
                                  },
                                  "secondaryColor": {
                                    "type": "string",
                                    "example": "#000000",
                                    "description": "Secondary color of the category"
                                  },
                                  "deleted": {
                                    "type": "boolean",
                                    "example": false,
                                    "description": "Indicates if the category is deleted"
                                  },
                                  "locationId": {
                                    "type": "string",
                                    "example": "fvg1TXIiVxGcdOaL0riG",
                                    "description": "Location ID"
                                  },
                                  "createdBy": {
                                    "type": "string",
                                    "example": "SQ6d63Va2PUbWEZ9k0TD",
                                    "description": "ID of the user who created the category"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "example": "2024-12-09T13:41:21.385Z",
                                    "description": "Creation timestamp"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "example": "2024-12-09T13:41:21.385Z",
                                    "description": "Last update timestamp"
                                  }
                                },
                                "title": "CategoryInfoDTO"
                              }
                            ]
                          }
                        },
                        "title": "CategoryQueueWithCategoryDTO"
                      }
                    ]
                  }
                },
                "title": "FetchQueueByIdResponseDTO"
              }
            ]
          },
          "traceId": {
            "type": "string",
            "description": "Trace ID for debugging",
            "example": "TRACE-abc123-def456"
          }
        },
        "required": [
          "success",
          "statusCode",
          "results"
        ],
        "title": "WrappedFetchQueueByIdResponseDTO"
      },
      "BadRequestDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 400
          },
          "message": {
            "type": "string",
            "example": "Bad Request"
          }
        },
        "title": "BadRequestDTO"
      },
      "UnauthorizedDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 401
          },
          "message": {
            "type": "string",
            "example": "Invalid token: access token is invalid"
          },
          "error": {
            "type": "string",
            "example": "Unauthorized"
          }
        },
        "title": "UnauthorizedDTO"
      },
      "UnprocessableDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 422
          },
          "message": {
            "example": [
              "Unprocessable Entity"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "error": {
            "type": "string",
            "example": "Unprocessable Entity"
          }
        },
        "title": "UnprocessableDTO"
      }
    }
  }
}
```

## Code Examples

**cURL**

```bash
curl -L -X GET 'https://services.leadconnectorhq.com/social-media-posting/category/queues/<queueId>?locationId=<LOCATIONID>' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: v3'
```

**Node.js**

```javascript
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: 'v3'
  }
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/social-media-posting/category/queues/<queueId>?locationId=<LOCATIONID>', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/social-media-posting/category/queues/{queueId}"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "v3"
}

params = {
    "locationId": "<LOCATIONID>"
}

response = requests.get(url, params=params, headers=headers)
print(response.json())
```

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/social-media-posting/category/queues/<queueId>?locationId=<LOCATIONID>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: v3',
  ],
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .get("https://services.leadconnectorhq.com/social-media-posting/category/queues/<queueId>?locationId=<LOCATIONID>")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "v3")
  .asString();
```

**Go**

```go
package main

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

func main() {
  url := "https://services.leadconnectorhq.com/social-media-posting/category/queues/<queueId>?locationId=<LOCATIONID>"
  req, _ := http.NewRequest("GET", url, nil)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "v3")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/social-media-posting/category/queues/<queueId>?locationId=<LOCATIONID>")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "v3"

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

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "v3"
}

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/social-media-posting/category/queues/<queueId>?locationId=<LOCATIONID>' -Method 'GET' -Headers $headers
$response | ConvertTo-Json
```
