Documentation ¶
Overview ¶
Package department 通讯录/部门管理
Index ¶
- func Create(ctx *dingding.App, payload []byte) (resp []byte, err error)
- func Delete(ctx *dingding.App, params url.Values) (resp []byte, err error)
- func Get(ctx *dingding.App, params url.Values) (resp []byte, err error)
- func List(ctx *dingding.App) (resp []byte, err error)
- func ListIds(ctx *dingding.App, params url.Values) (resp []byte, err error)
- func ListParentDepts(ctx *dingding.App, params url.Values) (resp []byte, err error)
- func ListParentDeptsByDept(ctx *dingding.App, params url.Values) (resp []byte, err error)
- func Update(ctx *dingding.App, payload []byte) (resp []byte, err error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
创建部门
See: https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq
POST https://oapi.dingtalk.com/department/create?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/dingding" "github.com/fastwego/dingding/apis/contact/department" ) func main() { var ctx *dingding.App payload := []byte("{}") resp, err := department.Create(ctx, payload) fmt.Println(resp, err) }
Output:
func Delete ¶
删除部门
See: https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq
GET https://oapi.dingtalk.com/department/delete?access_token=ACCESS_TOKENid=ID
Example ¶
package main import ( "fmt" "net/url" "github.com/fastwego/dingding" "github.com/fastwego/dingding/apis/contact/department" ) func main() { var ctx *dingding.App params := url.Values{} resp, err := department.Delete(ctx, params) fmt.Println(resp, err) }
Output:
func Get ¶
获取部门详情
See: https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq
GET https://oapi.dingtalk.com/department/get?access_token=ACCESS_TOKENid=123
Example ¶
package main import ( "fmt" "net/url" "github.com/fastwego/dingding" "github.com/fastwego/dingding/apis/contact/department" ) func main() { var ctx *dingding.App params := url.Values{} resp, err := department.Get(ctx, params) fmt.Println(resp, err) }
Output:
func List ¶
获取部门列表
See: https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq
GET https://oapi.dingtalk.com/department/list?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/dingding" "github.com/fastwego/dingding/apis/contact/department" ) func main() { var ctx *dingding.App resp, err := department.List(ctx) fmt.Println(resp, err) }
Output:
func ListIds ¶
获取子部门ID列表
See: https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq
GET https://oapi.dingtalk.com/department/list_ids?access_token=ACCESS_TOKENid=ID
Example ¶
package main import ( "fmt" "net/url" "github.com/fastwego/dingding" "github.com/fastwego/dingding/apis/contact/department" ) func main() { var ctx *dingding.App params := url.Values{} resp, err := department.ListIds(ctx, params) fmt.Println(resp, err) }
Output:
func ListParentDepts ¶
查询指定用户的所有上级父部门路径
See: https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq
GET https://oapi.dingtalk.com/department/list_parent_depts?access_token=ACCESS_TOKENuserId=USERID
Example ¶
package main import ( "fmt" "net/url" "github.com/fastwego/dingding" "github.com/fastwego/dingding/apis/contact/department" ) func main() { var ctx *dingding.App params := url.Values{} resp, err := department.ListParentDepts(ctx, params) fmt.Println(resp, err) }
Output:
func ListParentDeptsByDept ¶
查询部门的所有上级父部门路径
See: https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq
GET https://oapi.dingtalk.com/department/list_parent_depts_by_dept?access_token=ACCESS_TOKENid=ID
Example ¶
package main import ( "fmt" "net/url" "github.com/fastwego/dingding" "github.com/fastwego/dingding/apis/contact/department" ) func main() { var ctx *dingding.App params := url.Values{} resp, err := department.ListParentDeptsByDept(ctx, params) fmt.Println(resp, err) }
Output:
func Update ¶
更新部门
See: https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq
POST https://oapi.dingtalk.com/department/update?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/dingding" "github.com/fastwego/dingding/apis/contact/department" ) func main() { var ctx *dingding.App payload := []byte("{}") resp, err := department.Update(ctx, payload) fmt.Println(resp, err) }
Output:
Types ¶
This section is empty.