[1.2] Searching and sorting address books
Address book list
Address book search can be performed by specifying one or more of the following criteria.
GET /v1/organizations/:organization_id/address_books
Search criteria
Parameter | Type | Description | Example |
---|---|---|---|
| Integer Array | Searches for address books with the stated ID. Searches for address books with the stated IDs. |
|
| String | Searches for address books whose name contains the specified string. |
|
| String | Searches for address books in which the first name contains the specified string. |
|
| String | Searches for address books in which the last name contains the specified string. |
|
| String Array | Searches for address books in which the e-mail address is the same as the specified string. Searches for address books with the indicated e-mail addresses. |
|
| String Array | Searches for address books in which the telephone number is the same as the specified string. Searches for address books with the indicated phone numbers. |
|
| Boolean | Searches for address books in which the parcel station shipment sender is the same as the specified string. |
|
| Boolean | Searches for address books in which the courier shipment sender is the same as the specified string. |
|
| Boolean | Searches for address books in which the letter shipment sender is the same as the specified string. |
|
| String | Searches for address books in which the type is sender (sender), or receiver (receiver). |
|
| Date | Searches for collection orders created on the given day. |
|
| Time | Searches for collection orders whose creation time is >= specified time. The time can be provided in the ISO 8601 or similar format, and as a timestamp. |
|
| Time | Searches for collection orders whose creation time is <= specified time. The time can be provided in the ISO 8601 or similar format, and as a timestamp. |
|
| String | Searches for address books in which the first main address line (street) contains the specified string. |
|
| String | Searches for address books in which the first delivery address line (street) contains the specified string. |
|
| String | Searches for address books in which the company name contains the specified string. |
|
| String | Searches for address books in which the preferred shipping point contains the specified string. |
|
Sort criteria
Search results can be sorted using the sort_by
parameter using the following values:
sort_by value | Description | Example |
---|---|---|
| Sorts address books by ID. |
|
| Sorts address books by name. |
|
| Sorts address books by first name. |
|
| Sorts address books by last name. |
|
| Sorts address books by email address. |
|
| Sorts address books by phone number. |
|
| Sorts address books by parcel station shipment sender. |
|
| Sorts address books by courier shipment sender. |
|
| Sorts address books by letter shipment sender. |
|
| Sorts address books by kind. |
|
| Sorts address books by creation time. |
|
| Sorts address books by company name |
|
| Sorts address books by preferred dropoff point |
|
Sorting can be descending or ascending and is controlled by the sort_order
parameter. By default, the sorting order is descending
on the created_at
attribute.
sort_order value | Description | Example |
---|---|---|
| Sorts address books ascending. |
|
| Sorts address books descending. |
|
Simple request
curl -X GET https://api-shipx-pl.easypack24.net/v1/organizations/1/address_books?sort_order=asc&sort_by=last_name&sender_letter=true -H 'Authorization: Bearer token' -H 'Content-Type: application/json'
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"href":"https://api-shipx-pl.easypack24.net/v1/address_books?sender_letter=true\u0026sort_by=last_name\u0026sort_order=asc",
"count":1,
"page":1,
"per_page":30,
"items":[
{
"id":5,
"first_name":"Jan",
"last_name":"Nowak",
"email":"jan@nowak.pl",
"phone":"123456789",
"created_at":"2016-02-24T09:22:27.212+01:00",
"updated_at":"2016-02-24T09:22:27.212+01:00",
"organization_id":1,
"name":"Nowak Corp",
"sender_parcel":false,
"sender_courier":false,
"sender_letter":true,
"kind": "sender",
"company_name": "MyCompanyName",
"preferred_dropoff_point": "KRA120",
"main_address":{
"id": "123",
"street": "Malborska",
"building_number": "130",
"city":"Warsaw","id": "123",
"post_code":"33-666",
"country_code":"PO"
},
"delivery_address":{
"id": "123",
"street": "Malborska",
"building_number": "140",
"city":"Cracow",
"post_code":"66-666",
"country_code":"AZ"
}
}
]
}
On this page