Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Wyszukiwanie książek adresowych API X odbywa się poprzez podanie jednego lub więcej z poniższych kryteriów jako parametr w zapytaniu GET wykonanym na adres URI kolekcji punktów odbioru:

Address book list

Address book search can be performed by specifying one or more of the following criteria.

Code Block
languagejson
GET /v1/organizations/:organization_id/address_books

...

Sample request

GET /v1/organizations/12345/address_books HTTP/1.1

...

Authorization: Bearer lkfjasd9f70y43ohriw...[ommited for brevity]...

Search criteria

Parameter

Type

...

Description

Example

id 

Integer

Array

Searches for address books with the stated ID.

Searches for address books with the stated IDs.

?id=12

?id=12,17

name 

String

Searches for address books whose name contains the specified string.

?name=mag

first_name 

String

Searches for address books in which the first name contains the specified string.

?first_name=jan

last_name 

String

Searches for address books in which the last name contains the specified string.

?last_name=kowal

email 

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.

?email=magazyn1@firma.com

?email=

...

magazyn1@firma.com,

...

magazyn2@firma.com

phone 

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.

?phone=123123123

?phone=123123123,1231231234

sender_parcel 

Boolean

Searches for address books in which the parcel station shipment sender is the same as the specified string.

?sender_parcel=true

sender_courier 

Boolean

Searches for address books in which the courier shipment sender is the same as the specified string.

?sender_courier=true

sender_letter 

Boolean

Searches for address books in which the letter shipment sender is the same as the specified string.

?sender_letter=true

kind 

String

Searches for address books in which the type is sender (sender), or receiver (receiver).

?kind=sender

created_at 

Date

Searches for collection orders created on the given day.

?created_at=2016-01-07

created_at_gteq 

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.

?created_at_gteq=2016-01-01T13:10+01:00

?created_at_gteq=1451650200

created_at_lteq 

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.

?created_at_lteq=2016-01-01T13:10+01:00

?created_at_lteq=1451650200

main_address_street 

String

Searches for address books in which the first main address line (street) contains the specified string.

?main_address_street=Zaw

delivery_address_street 

String

Searches for address books in which the first delivery address line (street) contains the specified string.

?delivery_address_street=Zaw

company_name 

String

Searches for address books in which the company name contains the specified string.

?company_name=TestCompanyName

preferred_dropoff_point 

String

Searches for address books in which the preferred shipping point contains the specified string.

?preferred_dropoff_point=KRA120

...

Sort criteria

Search results can be sorted

...

using the sort_by  parameter

...

using the following values:

sort_by value

...

Description

Example

id

Sorts address books by ID.

?sort_by=id

name

Sorts address books by name.

?sort_by=name

first_name 

Sorts address books by first name.

?sort_by=first_name

last_name 

Sorts address books by last name.

?sort_by=last_name

email

Sorts address books by email address.

?sort_by=email

phone 

Sorts address books by phone number.

?sort_by=phone

sender_parcel 

Sorts address books by parcel station shipment sender.

?sort_by=sender_parcel

sender_courier 

Sorts address books by courier shipment sender.

?sort_by=sender_courier

sender_letter 

Sorts address books by letter shipment sender.

?sort_by=sender_letter

kind

...

 

Sorts address books by kind.

?sort_by=kind

created_at

...

 

Sorts address books by creation time.

?sort_by=created_at

company_name

...

 

Sorts address books by company name

?sort_by=company_name

preferred_dropoff_point

...

 

Sorts address books by preferred dropoff point

?sort_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

asc

Sorts

...

address books ascending.

?sort_order=asc&sort_by=id

desc

Sorts

...

address books descending.

?sort_order=desc&sort_by=id

...

Simple request

Code Block
languagejson
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

Code Block
languagejson
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

Table of Contents