Documentation ¶
Overview ¶
Package sheets 云文档/sheets
Index ¶
- func BatchUpdate(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
- func BatchUpdateStyle(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
- func CreateDimensionRange(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
- func DeleteDimensionRange(ctx *feishu.App, params url.Values, accessToken string) (resp []byte, err error)
- func InsertDimensionRange(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
- func MergeCells(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
- func MetaInfo(ctx *feishu.App, params url.Values, accessToken string) (resp []byte, err error)
- func ProtectedDimension(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
- func Range(ctx *feishu.App, params url.Values, accessToken string) (resp []byte, err error)
- func UnmergeCells(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
- func UpdateDimensionRange(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
- func UpdateProperties(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
- func UpdateStyle(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
- func Values(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
- func ValuesAppend(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
- func ValuesBatchGet(ctx *feishu.App, params url.Values, accessToken string) (resp []byte, err error)
- func ValuesBatchUpdate(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
- func ValuesPrepend(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BatchUpdate ¶
func BatchUpdate(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
操作子表/更新子表属性
该接口用于根据 spreadsheetToken 操作表格,如增加sheet,复制sheet、删除sheet。
See: https://open.feishu.cn/document/ugTM5UjL4ETO14COxkTN/uYTMzUjL2EzM14iNxMTN
POST https://open.feishu.cn/open-apis/sheet/v2/spreadsheets/:spreadsheetToken/sheets_batch_update
Example ¶
package main import ( "fmt" "net/url" "github.com/ylck/feishu" "github.com/ylck/feishu/apis/capabilities/document/sheets" ) func main() { var ctx *feishu.App payload := []byte("{}") params := url.Values{} accessToken := "" resp, err := sheets.BatchUpdate(ctx, payload, params, accessToken) fmt.Println(resp, err) }
Output:
func BatchUpdateStyle ¶
func BatchUpdateStyle(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
批量设置单元格样式
该接口用于根据 spreadsheetToken 、range和样式信息 批量更新单元格样式;单次写入不超过5000行,100列。
See: https://open.feishu.cn/document/ugTM5UjL4ETO14COxkTN/uAzMzUjLwMzM14CMzMTN
PUT https://open.feishu.cn/open-apis/sheet/v2/spreadsheets/:spreadsheetToken/styles_batch_update
Example ¶
package main import ( "fmt" "net/url" "github.com/ylck/feishu" "github.com/ylck/feishu/apis/capabilities/document/sheets" ) func main() { var ctx *feishu.App payload := []byte("{}") params := url.Values{} accessToken := "" resp, err := sheets.BatchUpdateStyle(ctx, payload, params, accessToken) fmt.Println(resp, err) }
Output:
func CreateDimensionRange ¶
func CreateDimensionRange(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
增加行列
该接口用于根据 spreadsheetToken 和长度,在末尾增加空行/列;单次操作不超过5000行或列。
See: https://open.feishu.cn/document/ugTM5UjL4ETO14COxkTN/uUjMzUjL1IzM14SNyMTN
POST https://open.feishu.cn/open-apis/sheet/v2/spreadsheets/:spreadsheetToken/dimension_range
Example ¶
package main import ( "fmt" "net/url" "github.com/ylck/feishu" "github.com/ylck/feishu/apis/capabilities/document/sheets" ) func main() { var ctx *feishu.App payload := []byte("{}") params := url.Values{} accessToken := "" resp, err := sheets.CreateDimensionRange(ctx, payload, params, accessToken) fmt.Println(resp, err) }
Output:
func DeleteDimensionRange ¶
func DeleteDimensionRange(ctx *feishu.App, params url.Values, accessToken string) (resp []byte, err error)
删除行列
该接口用于根据 spreadsheetToken 和维度信息删除行/列 。单次删除最大5000行/列。
See: https://open.feishu.cn/document/ugTM5UjL4ETO14COxkTN/ucjMzUjL3IzM14yNyMTN
DELETE https://open.feishu.cn/open-apis/sheet/v2/spreadsheets/:spreadsheetToken/dimension_range
Example ¶
package main import ( "fmt" "net/url" "github.com/ylck/feishu" "github.com/ylck/feishu/apis/capabilities/document/sheets" ) func main() { var ctx *feishu.App params := url.Values{} accessToken := "" resp, err := sheets.DeleteDimensionRange(ctx, params, accessToken) fmt.Println(resp, err) }
Output:
func InsertDimensionRange ¶
func InsertDimensionRange(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
插入行列
该接口用于根据 spreadsheetToken 和维度信息 插入空行/列 。如 startIndex=3, endIndex=7,则从第 4 行开始开始插入行列,一直到第 7 行,共插入 4 行;单次操作不超过5000行或列。
See: https://open.feishu.cn/document/ugTM5UjL4ETO14COxkTN/uQjMzUjL0IzM14CNyMTN
POST https://open.feishu.cn/open-apis/sheet/v2/spreadsheets/:spreadsheetToken/insert_dimension_range
Example ¶
package main import ( "fmt" "net/url" "github.com/ylck/feishu" "github.com/ylck/feishu/apis/capabilities/document/sheets" ) func main() { var ctx *feishu.App payload := []byte("{}") params := url.Values{} accessToken := "" resp, err := sheets.InsertDimensionRange(ctx, payload, params, accessToken) fmt.Println(resp, err) }
Output:
func MergeCells ¶
func MergeCells(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
合并单元格
该接口用于根据 spreadsheetToken 和维度信息合并单元格;单次操作不超过5000行,100列。
See: https://open.feishu.cn/document/ugTM5UjL4ETO14COxkTN/ukDNzUjL5QzM14SO0MTN
POST https://open.feishu.cn/open-apis/sheet/v2/spreadsheets/:spreadsheetToken/merge_cells
Example ¶
package main import ( "fmt" "net/url" "github.com/ylck/feishu" "github.com/ylck/feishu/apis/capabilities/document/sheets" ) func main() { var ctx *feishu.App payload := []byte("{}") params := url.Values{} accessToken := "" resp, err := sheets.MergeCells(ctx, payload, params, accessToken) fmt.Println(resp, err) }
Output:
func MetaInfo ¶
获取表格元数据
该接口用于根据 spreadsheetToken 获取表格元数据。
See: https://open.feishu.cn/document/ugTM5UjL4ETO14COxkTN/uETMzUjLxEzM14SMxMTN
GET https://open.feishu.cn/open-apis/sheet/v2/spreadsheets/:spreadsheetToken/metainfo
Example ¶
package main import ( "fmt" "net/url" "github.com/ylck/feishu" "github.com/ylck/feishu/apis/capabilities/document/sheets" ) func main() { var ctx *feishu.App params := url.Values{} accessToken := "" resp, err := sheets.MetaInfo(ctx, params, accessToken) fmt.Println(resp, err) }
Output:
func ProtectedDimension ¶
func ProtectedDimension(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
增加锁定单元格
该接口用于根据 spreadsheetToken 和维度信息增加多个范围的锁定单元格;单次操作不超过5000行或列。
See: https://open.feishu.cn/document/ugTM5UjL4ETO14COxkTN/ugDNzUjL4QzM14CO0MTN
POST https://open.feishu.cn/open-apis/sheet/v2/spreadsheets/:spreadsheetToken/protected_dimension
Example ¶
package main import ( "fmt" "net/url" "github.com/ylck/feishu" "github.com/ylck/feishu/apis/capabilities/document/sheets" ) func main() { var ctx *feishu.App payload := []byte("{}") params := url.Values{} accessToken := "" resp, err := sheets.ProtectedDimension(ctx, payload, params, accessToken) fmt.Println(resp, err) }
Output:
func Range ¶
读取单个范围
该接口用于根据 spreadsheetToken 和 range 读取表格单个范围的值,返回数据限制为10M。
See: https://open.feishu.cn/document/ugTM5UjL4ETO14COxkTN/ugTMzUjL4EzM14COxMTN
GET https://open.feishu.cn/open-apis/sheet/v2/spreadsheets/:spreadsheetToken/values/:range
Example ¶
package main import ( "fmt" "net/url" "github.com/ylck/feishu" "github.com/ylck/feishu/apis/capabilities/document/sheets" ) func main() { var ctx *feishu.App params := url.Values{} accessToken := "" resp, err := sheets.Range(ctx, params, accessToken) fmt.Println(resp, err) }
Output:
func UnmergeCells ¶
func UnmergeCells(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
拆分单元格
该接口用于根据 spreadsheetToken 和维度信息拆分单元格;单次操作不超过5000行,100列。
See: https://open.feishu.cn/document/ugTM5UjL4ETO14COxkTN/uATNzUjLwUzM14CM1MTN
POST https://open.feishu.cn/open-apis/sheet/v2/spreadsheets/:spreadsheetToken/unmerge_cells
Example ¶
package main import ( "fmt" "net/url" "github.com/ylck/feishu" "github.com/ylck/feishu/apis/capabilities/document/sheets" ) func main() { var ctx *feishu.App payload := []byte("{}") params := url.Values{} accessToken := "" resp, err := sheets.UnmergeCells(ctx, payload, params, accessToken) fmt.Println(resp, err) }
Output:
func UpdateDimensionRange ¶
func UpdateDimensionRange(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
更新行列
该接口用于根据 spreadsheetToken 和维度信息更新隐藏行列、单元格大小;单次操作不超过5000行或列。
See: https://open.feishu.cn/document/ugTM5UjL4ETO14COxkTN/uYjMzUjL2IzM14iNyMTN
PUT https://open.feishu.cn/open-apis/sheet/v2/spreadsheets/:spreadsheetToken/dimension_range
Example ¶
package main import ( "fmt" "net/url" "github.com/ylck/feishu" "github.com/ylck/feishu/apis/capabilities/document/sheets" ) func main() { var ctx *feishu.App payload := []byte("{}") params := url.Values{} accessToken := "" resp, err := sheets.UpdateDimensionRange(ctx, payload, params, accessToken) fmt.Println(resp, err) }
Output:
func UpdateProperties ¶
func UpdateProperties(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
更新表格属性
该接口用于根据 spreadsheetToken 更新表格属性,如更新表格标题。
See: https://open.feishu.cn/document/ugTM5UjL4ETO14COxkTN/ucTMzUjL3EzM14yNxMTN
PUT https://open.feishu.cn/open-apis/sheet/v2/spreadsheets/:spreadsheetToken/properties
Example ¶
package main import ( "fmt" "net/url" "github.com/ylck/feishu" "github.com/ylck/feishu/apis/capabilities/document/sheets" ) func main() { var ctx *feishu.App payload := []byte("{}") params := url.Values{} accessToken := "" resp, err := sheets.UpdateProperties(ctx, payload, params, accessToken) fmt.Println(resp, err) }
Output:
func UpdateStyle ¶
func UpdateStyle(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
设置单元格样式
该接口用于根据 spreadsheetToken 、range 和样式信息更新单元格样式;单次写入不超过5000行,100列。
See: https://open.feishu.cn/document/ugTM5UjL4ETO14COxkTN/ukjMzUjL5IzM14SOyMTN
PUT https://open.feishu.cn/open-apis/sheet/v2/spreadsheets/:spreadsheetToken/style
Example ¶
package main import ( "fmt" "net/url" "github.com/ylck/feishu" "github.com/ylck/feishu/apis/capabilities/document/sheets" ) func main() { var ctx *feishu.App payload := []byte("{}") params := url.Values{} accessToken := "" resp, err := sheets.UpdateStyle(ctx, payload, params, accessToken) fmt.Println(resp, err) }
Output:
func Values ¶
func Values(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
向单个范围写入数据
该接口用于根据 spreadsheetToken 和 range 向单个范围写入数据,若范围内有数据,将被更新覆盖;单次写入不超过5000行,100列,每个格子大小为0.5M。
See: https://open.feishu.cn/document/ugTM5UjL4ETO14COxkTN/uAjMzUjLwIzM14CMyMTN
PUT https://open.feishu.cn/open-apis/sheet/v2/spreadsheets/:spreadsheetToken/values
Example ¶
package main import ( "fmt" "net/url" "github.com/ylck/feishu" "github.com/ylck/feishu/apis/capabilities/document/sheets" ) func main() { var ctx *feishu.App payload := []byte("{}") params := url.Values{} accessToken := "" resp, err := sheets.Values(ctx, payload, params, accessToken) fmt.Println(resp, err) }
Output:
func ValuesAppend ¶
func ValuesAppend(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
追加数据
该接口用于根据 spreadsheetToken 和 range 遇到空行则进行覆盖追加或新增行追加数据。 空行:默认该行第一个格子是空,则认为是空行;单次写入不超过5000行,100列,每个格子大小为0.5M。
See: https://open.feishu.cn/document/ugTM5UjL4ETO14COxkTN/uMjMzUjLzIzM14yMyMTN
POST https://open.feishu.cn/open-apis/sheet/v2/spreadsheets/:spreadsheetToken/values_append
Example ¶
package main import ( "fmt" "net/url" "github.com/ylck/feishu" "github.com/ylck/feishu/apis/capabilities/document/sheets" ) func main() { var ctx *feishu.App payload := []byte("{}") params := url.Values{} accessToken := "" resp, err := sheets.ValuesAppend(ctx, payload, params, accessToken) fmt.Println(resp, err) }
Output:
func ValuesBatchGet ¶
func ValuesBatchGet(ctx *feishu.App, params url.Values, accessToken string) (resp []byte, err error)
读取多个范围
该接口用于根据 spreadsheetToken 和 ranges 读取表格多个范围的值,返回数据限制为10M。
See: https://open.feishu.cn/document/ugTM5UjL4ETO14COxkTN/ukTMzUjL5EzM14SOxMTN
GET https://open.feishu.cn/open-apis/sheet/v2/spreadsheets/:spreadsheetToken/values_batch_get
Example ¶
package main import ( "fmt" "net/url" "github.com/ylck/feishu" "github.com/ylck/feishu/apis/capabilities/document/sheets" ) func main() { var ctx *feishu.App params := url.Values{} accessToken := "" resp, err := sheets.ValuesBatchGet(ctx, params, accessToken) fmt.Println(resp, err) }
Output:
func ValuesBatchUpdate ¶
func ValuesBatchUpdate(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
向多个范围写入数据
该接口用于根据 spreadsheetToken 和 range 向多个范围写入数据,若范围内有数据,将被更新覆盖;单次写入不超过5000行,100列,每个格子大小为0.5M。
See: https://open.feishu.cn/document/ugTM5UjL4ETO14COxkTN/uEjMzUjLxIzM14SMyMTN
POST https://open.feishu.cn/open-apis/sheet/v2/spreadsheets/:spreadsheetToken/values_batch_update
Example ¶
package main import ( "fmt" "net/url" "github.com/ylck/feishu" "github.com/ylck/feishu/apis/capabilities/document/sheets" ) func main() { var ctx *feishu.App payload := []byte("{}") params := url.Values{} accessToken := "" resp, err := sheets.ValuesBatchUpdate(ctx, payload, params, accessToken) fmt.Println(resp, err) }
Output:
func ValuesPrepend ¶
func ValuesPrepend(ctx *feishu.App, payload []byte, params url.Values, accessToken string) (resp []byte, err error)
插入数据
该接口用于根据 spreadsheetToken 和 range 向范围之前增加相应数据的行和相应的数据,相当于数组的插入操作;单次写入不超过5000行,100列,每个格子大小为0.5M。
See: https://open.feishu.cn/document/ugTM5UjL4ETO14COxkTN/uIjMzUjLyIzM14iMyMTN
POST https://open.feishu.cn/open-apis/sheet/v2/spreadsheets/:spreadsheetToken/values_prepend
Example ¶
package main import ( "fmt" "net/url" "github.com/ylck/feishu" "github.com/ylck/feishu/apis/capabilities/document/sheets" ) func main() { var ctx *feishu.App payload := []byte("{}") params := url.Values{} accessToken := "" resp, err := sheets.ValuesPrepend(ctx, payload, params, accessToken) fmt.Println(resp, err) }
Output:
Types ¶
This section is empty.