-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to use next link #27
Comments
It seems that for paginated APIs, it is necessary to parse
It seems that for paginated APIs, it is necessary to parse I plan to add a method similar to |
feat: Add `request` method for making API requests #27
v1.3.0 has been released, adding a new import { AppStoreConnectAPI } from "appstore-connect-sdk";
import { AppsApi, CustomerReviewsResponse } from "appstore-connect-sdk/openapi";
const client = new AppStoreConnectAPI({
issuerId: process.env.ISSUER_ID,
privateKeyId: process.env.PRIVATE_KEY_ID,
privateKey: process.env.PRIVATE_KEY,
});
const api = await client.create(AppsApi);
// fetch apps
const res = await api.appsGetCollection();
console.log('Fetch apps count:', res.data.length);
const appId = res.data[1].id;
// fetch reviews
const reviews = await api.appsCustomerReviewsGetToManyRelated({ id: appId });
console.log('Fetch reviews links:', reviews.links);
// fetch next page reviews
if (reviews.links.next) {
const nextPageRes = await client.request({
url: reviews.links.next
})
const nextPageReviews = (await nextPageRes.json()) as CustomerReviewsResponse
console.log('Fetch next page reviews:', nextPageReviews.meta?.paging.total);
}
|
When consuming customer reviews the response may contain a link to the next set of reviews. There does not seem to be a mechanism available on the API to handle this scenario.
The text was updated successfully, but these errors were encountered: