magento rest api (get products) is returning duplicate data - rest

i tried to retrieve all the products using magento rest api,
I used google chrome -> POSTMAN as restclient and specified the headers properly (Consumerkey, ConsumerSecret, token, token secret)
There are only 215 products in magento and i tried to access the products using restclient
https://domain.com/api/rest/products?type=rest&category_id=7&limit=100&page=1
Question :
on page no 3 it has to return only 15 products but it is returning 100 products, why? and if i specify page no as 4 or 5 or even 100000 means it is returning the response with duplicate data?

Related

REST API best practice : GET x objects for x number of customer ids

I want to design a rest endpoint where the requirement is to return list of objects (one for each customer_id)
how should I expose/name the endpoint:
GET (issue is : there can be big number of c_id, and thus avoiding this approach as some frameworks has limit on the url length)
/customers/customer_id=cid_1,cid_2
OR
POST
/customers-list/
Request Body: {customer_id: [cid_1,cid_2]}
NOTE: I have a POST also (to create a new customer):
POST
/customers
Request Body: {id: cid_1,name:"first_last",designation:"manager"}

Flutter - Handle page-specific REST API Query Parameters

I have an issue to pass multiple query params with page in url in Flutter
BASE_URL/products?page=1&brands[]=1&categories[]=1&tags[]=1&min_price=0&max_price=100
with page number = 1
and api query params brands[]=1&categories[]=1&tags[]=1&min_price=0&max_price=100
So How to Handle pagination with this query params.
I'm using this package => https://pub.dev/packages/flutter_paginator_ns
but not work with multiple query params because it take int as page number only.

how can make throttling per user per api and per resource of the api in wso2 api management 2.6?

I am using wso2 API management 2.6. I have 15 API in my store and every API has 5-10 resources (many 'get'-'post'-'delete'-'put'). I have 3 users (consumers) that every one has his own tiers for calling APIs. for example 'user1' can call just one 'get' resource of 'API1' ,all 'post' resources of API2 and can not call other resources in API1 , API2 and API3. This situation is same for user2 and user3. I don't know how can I make throttling tiers for this store?
I found this this example and change it to my own one like this :
key Template:
$userId:$resourceKey
siddhi query :
FROM RequestStream
SELECT userId, ( userId == 'userId#carbon.super' and resourceKey== '/api/1.0.0/resourceKey:GET') AS isEligible ,
str:concat('userId#carbon.super' , ':' , '/api/1.0.0/resourceKey:GET') as throttleKey
INSERT INTO EligibilityStream;
FROM EligibilityStream[isEligible==true]#throttler:timeBatch(1 min)
SELECT throttleKey, (count(userId) >= 1) as isThrottled, expiryTimeStamp group by throttleKey
INSERT ALL EVENTS into ResultStream;
I have this siddhi query but it doesn't work!
I don't know this info helps or not but my api request Url is : https://[APIAdress]/api/1.0.0/resourceKey

How do I export GLBudgetLineDetail via Rest API?

My goal is to export data from the [GLBudgetlineDetail] table via the Rest API.
To accomplish this:
1) I created created a custom endpoint based on the Budgets screen (Finance > General Ledger > Work Area > Enter > Budgets)
!(http://imgur.com/sQC0zOI)
2) I populated the endpoint by adding all the fields from the Budget Articles container
!(http://imgur.com/tZp2GMh)
When I query this endpoint, I only get an empty array returned "[]".
Here is the query:
GET http ://servername/WebServiceAPITest/entity/MyStore/6.00.001/Budget
Headers:
Content-Type -> application/json
("Budget" is the name I gave to the endpoint)
I can successfully query other endpoints (Accounts, Vendors, JournalTransactions, etc) but I can't get any data back from this one.
I created the MyStore Demo (Course I210) and have access to the [GLBudgetLineDetail] table and can verify that it has data. On the Budgets screen, if I filter to year 2013, Ledger 'Budget', Branch 'SOFT', I can see Budget information.
How do I get access to this info via the Rest API?
Since you mentioned the Course I210, You might want to refer yourself to the section 3.4.1 about Retrieving the Price of an Item for a Customer.
In that section, they are saying that if you want to retrieve data from an inquiry, you must use the Put command:
"Because you are retrieving the price of an item from the inquiry, you will use the Put() method to obtain data."
Since the Budget Screen is an Inquiry Screen you must use the Put command to set the parameter you want.
Here is one that I tried and that worked on an Acumatica web site with demo
data:
PUT http://localhost/Demo610u04/entity/BudgetEndpoint/6.00.001/Budget
Headers (Key -> Value):
Content-Type -> application/json
Accept -> application/json
Body :
{
"BudgetArticles":[{}],
"FinancialYear":{"Value":"2016"},
"Ledger":{"Value":"BUDGET"}
}
EDIT: Looking at the image you added, you should have your budget Filter fields in the main entity and have a sub entity of type Detail containing the Budget Articles fields

Getting multiple invoices from intuit anywhere api at once

When I update an invoice in QB (after its been changed in my system), I want to avoid updating anything that the user has modified in QB. My plan was to use the filter API method and filter by Ids to get the list of invoices from QB that my app created. However, it doesn't look like InvoiceFilter accepts ListIdSet. It does have a TransactionIdSet, but I can't find a way to get ahold of that number (i.e., the TransactionId) via Data Services. It's certainly not in the response when invoices are read. So, how do I query for a specific set of invoices via the API?
The transaction id refers to the id of the invoice here.
For eg, the following invoice query will retrieve the invoice with Id 4 -
<InvoiceQuery xmlns="http://www.intuit.com/sb/cdm/v2">
<TransactionIdSet>
<Id idDomain="QB">4</Id>
</TransactionIdSet>
</InvoiceQuery>