บริการตัวแทนจำหน่าย Google Workspace สำหรับ Admin SDK

Google Workspace บริการตัวแทนจำหน่ายของ SDK ผู้ดูแลระบบช่วยให้คุณใช้ Admin SDK Reseller API ใน Apps Script ได้ API นี้ช่วยให้ผู้ดูแลระบบตัวแทนจำหน่ายที่ได้รับอนุญาตส่งคำสั่งซื้อของลูกค้าและจัดการ Google Workspace การสมัครใช้บริการแบบชำระเงินภายหลังรายเดือนได้

ข้อมูลอ้างอิง

หากต้องการข้อมูลโดยละเอียดเกี่ยวกับบริการนี้ โปรดดูเอกสารอ้างอิงสำหรับ Admin SDK Google Workspace Reseller API Admin SDK นั้น Google Workspace บริการตัวแทนจำหน่ายจะใช้ออบเจ็กต์ เมธอด และพารามิเตอร์เดียวกันกับ API สาธารณะ เช่นเดียวกับบริการขั้นสูงทั้งหมดใน Apps Script โปรดดูข้อมูลเพิ่มเติมที่หัวข้อวิธีกำหนดลายเซ็นของเมธอด

หากต้องการรายงานปัญหาและค้นหาการสนับสนุนอื่นๆ โปรดดูคู่มือการสนับสนุนสำหรับตัวแทนจำหน่าย Admin SDK

รหัสตัวอย่าง

โค้ดตัวอย่างด้านล่างใช้ API เวอร์ชัน 1

ดูรายการการสมัครใช้บริการ

ตัวอย่างนี้บันทึกรายการการสมัครใช้บริการ ซึ่งรวมถึงรหัสลูกค้า วันที่สร้าง ชื่อแพ็กเกจ และรหัส SKU โปรดสังเกตการใช้โทเค็นของหน้าเว็บเพื่อเข้าถึงรายการผลการค้นหาทั้งหมด

advanced/adminSDK.gs
/**
 * 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
 */
function getSubscriptions() {
  let result;
  let pageToken;
  do {
    result = AdminReseller.Subscriptions.list({
      pageToken: pageToken
    });
    for (const sub of result.subscriptions) {
      const creationDate = new Date();
      creationDate.setUTCSeconds(sub.creationTime);
      console.log('customer ID: %s, date created: %s, plan name: %s, sku id: %s',
          sub.customerId, creationDate.toDateString(), sub.plan.planName,
          sub.skuId);
    }
    pageToken = result.nextPageToken;
  } while (pageToken);
}