Method: spreadsheets.values.get
แสดงผลช่วงของค่าจากสเปรดชีต ผู้เรียกใช้ต้องระบุรหัสสเปรดชีตและช่วง
คำขอ HTTP
GET https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/{range}
URL ใช้ไวยากรณ์การแปลง gRPC
พารามิเตอร์เส้นทาง
พารามิเตอร์ |
spreadsheetId |
string
รหัสของสเปรดชีตที่จะดึงข้อมูล
|
range |
string
รูปแบบ A1 หรือ R1C1 ของช่วงที่จะดึงค่ามา
|
พารามิเตอร์การค้นหา
พารามิเตอร์ |
majorDimension |
enum (Dimension )
มิติข้อมูลหลักที่ผลลัพธ์ควรใช้ เช่น หากข้อมูลสเปรดชีตใน Sheet1 คือ A1=1,B1=2,A2=3,B2=4 การขอ range=Sheet1!A1:B2?majorDimension=ROWS จะแสดงผล [[1,2],[3,4]] ในขณะที่การขอ range=Sheet1!A1:B2?majorDimension=COLUMNS จะแสดงผล [[1,3],[2,4]]
|
valueRenderOption |
enum (ValueRenderOption )
ลักษณะการแสดงค่าในเอาต์พุต ตัวเลือกการแสดงผลเริ่มต้นคือ FORMATTED_VALUE
|
dateTimeRenderOption |
enum (DateTimeRenderOption )
วิธีการแสดงวันที่ เวลา และระยะเวลาในเอาต์พุต ระบบจะไม่สนใจโค้ดนี้หาก valueRenderOption คือ FORMATTED_VALUE ตัวเลือกการแสดงผล dateTime เริ่มต้นคือ SERIAL_NUMBER
|
เนื้อหาของคำขอ
เนื้อหาของคำขอต้องว่างเปล่า
เนื้อหาการตอบกลับ
หากทำสำเร็จ เนื้อหาการตอบกลับจะมีอินสแตนซ์ ValueRange
ขอบเขตการให้สิทธิ์
ต้องใช้ขอบเขต OAuth อย่างใดอย่างหนึ่งต่อไปนี้
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.readonly
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/spreadsheets
https://www.googleapis.com/auth/spreadsheets.readonly
โปรดดูข้อมูลเพิ่มเติมที่คู่มือการให้สิทธิ์
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-09-05 UTC
[null,null,["อัปเดตล่าสุด 2024-09-05 UTC"],[[["This Google Sheets API endpoint retrieves a range of values from a specified spreadsheet and range using an HTTP GET request."],["Users need to provide the `spreadsheetId` and `range` as path parameters in the request URL."],["Optional query parameters allow customization of the output, including `majorDimension`, `valueRenderOption`, and `dateTimeRenderOption`."],["The response body, upon successful execution, will contain a `ValueRange` object with the requested data."],["Authorization is required using one of the specified OAuth scopes related to Google Drive or Google Sheets access."]]],["This describes retrieving data from a spreadsheet using a `GET` HTTP request. The request URL includes the `spreadsheetId` and `range` as path parameters. Optional query parameters, like `majorDimension`, `valueRenderOption`, and `dateTimeRenderOption`, allow customization of the returned data. The request body must be empty. The response contains the spreadsheet data in `ValueRange` format if the request is successful. Authentication requires specific OAuth scopes for access.\n"]]