Usługa w pakiecie Admin SDK Google Workspace Reseller umożliwia korzystanie z interfejsu Admin SDK Reseller API w usłudze Apps Script.
Interfejs API umożliwia autoryzowanym administratorom sprzedawców składanie zamówień przez klientów i zarządzanie miesięcznymi subskrypcjami z płatnością z dołu. Google Workspace
Dokumentacja
Szczegółowe informacje o tej usłudze znajdziesz w dokumentacji referencyjnej interfejsu Admin SDK Google Workspace Reseller API. Podobnie jak wszystkie zaawansowane usługi w Google Apps Script, usługaGoogle Workspace Reseller w pakiecie Admin SDK korzysta z tych samych obiektów, metod i parametrów co publiczny interfejs API. Więcej informacji znajdziesz w artykule Jak określane są podpisy metod.
Przykładowy kod poniżej korzysta z wersji 1 interfejsu API.
Pobieranie listy subskrypcji
Ten przykład rejestruje listę subskrypcji, w tym identyfikator klienta, datę utworzenia, nazwę planu i identyfikator SKU.
Zwróć uwagę, że do uzyskania dostępu do pełnej listy wyników używasz tokenów strony.
/** * Logs the list of subscriptions, including the customer ID, date created, plan * name, and the sku ID. Notice the use of page tokens to access the full list * of results. * @see https://developers.google.com/admin-sdk/reseller/reference/rest/v1/subscriptions/list */functiongetSubscriptions(){letresult;letpageToken;do{result=AdminReseller.Subscriptions.list({pageToken:pageToken});for(constsubofresult.subscriptions){constcreationDate=newDate();creationDate.setUTCSeconds(sub.creationTime);console.log('customerID:%s,datecreated:%s,planname:%s,skuid:%s',sub.customerId,creationDate.toDateString(),sub.plan.planName,sub.skuId);}pageToken=result.nextPageToken;}while(pageToken);}
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-05-08 UTC."],[[["The Admin SDK Google Workspace Reseller service enables authorized reseller admins to manage Google Workspace subscriptions and place customer orders via Apps Script."],["This advanced service requires prior enabling before use and mirrors the functionality of the Admin SDK Reseller API."],["Comprehensive reference documentation, support resources, and sample code are readily available for developers."],["Sample code showcases how to retrieve and log a list of subscriptions, demonstrating pagination for accessing the complete result set."]]],[]]