[#678] Get Providers List

Migrated from Redmine #678 | Author: Bogdan Shyker
Status: New | Priority: High, I’m very impatient | Created: 2021-03-30


Hi!
I’m integrating via Rest Api and stuck with getting the providers list. I see from the docs that the endpoint will return paginated result, but I don’t see query parameters to iterate through pages in the example.

How can I retrieve all providers via REST API?

Thanks in advance!

Redmine Admin wrote:

there are no params needed to get list of all providers

GET https://user-api-v2.simplybook.me/admin/providers?filter[search]=mike&filter[service_id]=1
Content-Type: application/json
X-Company-Login: 
X-Token: 

Bogdan Shyker wrote:

Redmine Admin wrote:

there are no params needed to get list of all providers

[…]

It returns data in this format(json below).
As far as I understand, if I have 20 Providers, I’ll have to go to page 2 like: https://user-api-v2.simplybook.me/admin/providers?filter[search]=mike&filter[service_id]=1&page=2.
Or how can I retrieve all providers with 1 request?

{
“data”: [
{
“id”: 1,
“name”: “AnkaraStation for buying cars”,
“qty”: 4,
“email”: “shykerbogdan@gmail.com”,
“description”: “appointment system for cars”,
“phone”: “+380974727944”,
“picture”: null,
“picture_preview”: null,
“color”: null,
“is_active”: true
}
…9 more provider…

],
"metadata": {
    "items_count": 5,
    "pages_count": 1,
    "page": 1,
    "on_page": 10
}

}

Redmine Admin wrote:

it will redurn all providers, just do not pass page

Bogdan Shyker wrote:

Oh, great!
So, just to make sure, i will recive
“data”: [ {
“id”: 1,
“name”: “AnkaraStation for buying cars”,
“qty”: 4,
“email”: “shykerbogdan@gmail.com”,
“description”: “appointment system for cars”,
“phone”: “+380974727944”,
“picture”: null,
“picture_preview”: null,
“color”: null,
“is_active”: true
}
…19 more provider…
]

  • metadata?
    What is the point of metadata then?