listOrders

View as MarkdownOpen in Claude

List number assignment orders for a campaign.

Path parameters

idstringRequiredformat: "uuid"
Unique ID of the campaign.

Query parameters

filter_statestringOptional
The state of the orders in the registration process, such as pending or processed. Will return all orders with this value.

Response

datalist of objectsOptional
List of orders.

Response Example

Response
1{
2 "links": {
3 "self": "string",
4 "first": "string",
5 "next": "string",
6 "prev": "string"
7 },
8 "data": [
9 {
10 "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
11 "state": "pending",
12 "processed_at": "2024-01-15T09:30:00Z",
13 "created_at": "2024-01-15T09:30:00Z",
14 "updated_at": "2024-01-15T09:30:00Z",
15 "status_callback_url": "https://example.com/handle_callback"
16 }
17 ]
18}

Example

1import { RestClient } from "@signalwire/sdk";
2
3const client = new RestClient({
4 project: "your-project-id",
5 token: "your-api-token",
6 host: "your-space.signalwire.com"
7});
8
9const orders = await client.registry.campaigns.listOrders("campaign-id");
10for (const order of orders.data ?? []) {
11 console.log(order.id, order.status);
12}