1b.app
Link copied -

Pagination in api v2

How to receive data in parts using an api/v2/order/get/ request, I used offset, page, part, nothing helps, in the quality parameters, in the body of the request. Limit - it works, but it’s not clear how to get the next piece of data
Original question is available on version: ru

Answers:

https://tppr.me/ZagyOk limit+ ordertype+ filter-> lastid
those. from the last response received, take the lastid and send it to the next one
22.05.2024, 17:45
Original comment available on version: ru

Владислав
Leave a message in this thread and the user's contacts will be shown to you
And another problem is that if you add orderproductfields to json data by post request api/v2/order/get/, then not a single field from orderproductfields is returned, for example, I need to find out supplierinfo:
"fields": [
"id",
"name",
...............
],
"orderproductfields": [
"id",
"name",
"count",
"price",
"productcurrency",
"discount sum",
"discountpercent",
"pricewithdiscount",
"pricewithvat",
"pricewithoutvat",
"productsumwithvat",
"productsumwithoutvat",
"producttaxvalue",
"supplierinfo",
"productinfo"
],
22.05.2024, 17:56
Original comment available on version: ru

Give me the full json please, at first glance everything is ok. Did you add the "orderproducts" key to fields? It is needed so that process products are initially given, and through orderproductfields you already manage which fields are needed
23.05.2024, 10:55
Original comment available on version: ru

{
"fields": [
"id",
"name",
"description",
"workflow",
"author",
"client",
"status",
"orderproducts",
],
"orderproductfields": [
"supplierinfo",
"productinfo"
],
"limit": MAX_LIMIT,
"ordertype": "DESC",
"filter": {
"workflowname": "Project",
}
}
Это полный json на пост запрос /api/v2/order/get/
23.05.2024, 16:06

json is invalid. Check the validity of json before sending.
1. limit has an invalid value, the string must be wrapped in quotes or there must be a number
2. after workflowname": "Project" there is a comma - this is not possible in json
3. The same situation with rderproducts",
validity can be checked for example here http://json.parser.online.fr/
23.05.2024, 16:38
Original comment available on version: ru

I forgot to change the variable for limit to a number, MAX_LIMIT contains the number 200. I removed the extra commas, the same result, without the orderproducts fields
"fields": [
"id",
"name",
"author",
"client",
"status",
"orderproducts"
],
"orderproductfields": [
"supplierinfo",
"productinfo"
],
"limit": 200,
"ordertype": "DESC",
"filter": {
"workflowname": "Logistics Realization"
}
23.05.2024, 17:16
Original comment available on version: ru

Please give me a link to your box and a file with the full body of the request that is being sent, I will request a token for the API and repeat the request + see the result.
23.05.2024, 18:12
Original comment available on version: ru

Link to box - https://box.fialan.com
23.05.2024, 18:38
Original comment available on version: ru

Are you confused that you are requesting products for a power supply unit to which you do not add products? I was kind of confused...
Keep a request in which at least some products are given, this is the first process that comes across that has them.
curl -X 'POST'\
'https://box.fialan.com/api/v2/order/get/' \
-H 'accept: application/json' \
-d '{
"fields": [
"id",
"name",
"author",
"client",
"orderproducts"
],
"orderproductfields": [
"supplierinfo",
"productinfo",
"id",
"count",
"price"
],
"limit": 2,
"ordertype": "DESC",
"filter": {
"id": 209231
}
}'
answer
{"status":1,"dataArray":[{"id":"209231","name":"hhhh","orderproducts":[{"id":"1785","count":"8.000" ,"price":"0.0300","supplierinfo":[],"productinfo":[]},{"id":"1786","count":"745.000","price":"0.1000"," supplierinfo":[],"productinfo":[]},{"id":"1787","count":"272.000","price":"0.5000","supplierinfo":[],"productinfo": []},{"id":"1788","count":"0.000","price":"100.0000","supplierinfo":[],"productinfo":[]}],"client":{ "id":"90500","companies":[],"namefull":"hhh hh","name":"hh","namemiddle":"","namelast":"hh","phones" :["hh","hh","hh"],"emails":["hh"]},"author":{"id":"90500","companies":[],"namefull": "hh","name":"hh","namemiddle":"","namelast":"hh","phones":["hh","hh","hh"],"emails":[ "hh"]}}]}
24.05.2024, 10:29
Original comment available on version: ru

There is a Supplier in the Logistics Realization BP, but I can only get its id in customfields, for example for id = #1022577:
'supplier30': {'key': 'supplier30', 'name': 'Supplier', 'value': '159***'}
If you can’t get supplierinfo, then maybe you can get separate information on Supplier by its id?
24.05.2024, 14:37
Original comment available on version: ru

You are confusing additional process fields that you create and name yourself with the basic fields of the system. supplierinfo is information about suppliers of the process product (the product that you added to the product table), this field has no connection whatsoever with the additional field.
If you store the system user identifier in the additional field of the supplier30 process, you can obtain information about it using a separate request using the contact/get method, passing its identifier there according to the documentation.
24.05.2024, 14:44
Original comment available on version: ru

Please join the conversation. If you have something to say - please write a comment. You will need a mobile phone and an SMS code for identification to enter. Log in and comment