Documentation ¶
Overview ¶
Package user 通讯录/用户管理
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 GetAdmin(ctx *dingding.App) (resp []byte, err error)
- func GetAdminScope(ctx *dingding.App) (resp []byte, err error)
- func GetByMobile(ctx *dingding.App, params url.Values) (resp []byte, err error)
- func GetDeptMember(ctx *dingding.App, params url.Values) (resp []byte, err error)
- func GetOrgUserCount(ctx *dingding.App, params url.Values) (resp []byte, err error)
- func GetUseridByUnionid(ctx *dingding.App, params url.Values) (resp []byte, err error)
- func InactiveUserGet(ctx *dingding.App, payload []byte) (resp []byte, err error)
- func ListByPage(ctx *dingding.App, params url.Values) (resp []byte, err error)
- func SimpleList(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/ege851
POST https://oapi.dingtalk.com/user/create?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/dingding" "github.com/fastwego/dingding/apis/contact/user" ) func main() { var ctx *dingding.App payload := []byte("{}") resp, err := user.Create(ctx, payload) fmt.Println(resp, err) }
Output:
func Delete ¶
删除用户
See: https://ding-doc.dingtalk.com/doc#/serverapi2/ege851
GET https://oapi.dingtalk.com/user/delete?access_token=ACCESS_TOKENuserid=zhangsan
Example ¶
package main import ( "fmt" "net/url" "github.com/fastwego/dingding" "github.com/fastwego/dingding/apis/contact/user" ) func main() { var ctx *dingding.App params := url.Values{} resp, err := user.Delete(ctx, params) fmt.Println(resp, err) }
Output:
func Get ¶
获取用户详情
See: https://ding-doc.dingtalk.com/doc#/serverapi2/ege851
GET https://oapi.dingtalk.com/user/get?access_token=ACCESS_TOKENuserid=zhangsan
Example ¶
package main import ( "fmt" "net/url" "github.com/fastwego/dingding" "github.com/fastwego/dingding/apis/contact/user" ) func main() { var ctx *dingding.App params := url.Values{} resp, err := user.Get(ctx, params) fmt.Println(resp, err) }
Output:
func GetAdmin ¶
获取管理员列表
See: https://ding-doc.dingtalk.com/doc#/serverapi2/ege851
GET https://oapi.dingtalk.com/user/get_admin?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/dingding" "github.com/fastwego/dingding/apis/contact/user" ) func main() { var ctx *dingding.App resp, err := user.GetAdmin(ctx) fmt.Println(resp, err) }
Output:
func GetAdminScope ¶
获取管理员通讯录权限范围
See: https://ding-doc.dingtalk.com/doc#/serverapi2/ege851
GET https://oapi.dingtalk.com/topapi/user/get_admin_scope?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/dingding" "github.com/fastwego/dingding/apis/contact/user" ) func main() { var ctx *dingding.App resp, err := user.GetAdminScope(ctx) fmt.Println(resp, err) }
Output:
func GetByMobile ¶
根据手机号获取userid
See: https://ding-doc.dingtalk.com/doc#/serverapi2/ege851
GET https://oapi.dingtalk.com/user/get_by_mobile?access_token=ACCESS_TOKENmobile=1xxxxxxxxxx
Example ¶
package main import ( "fmt" "net/url" "github.com/fastwego/dingding" "github.com/fastwego/dingding/apis/contact/user" ) func main() { var ctx *dingding.App params := url.Values{} resp, err := user.GetByMobile(ctx, params) fmt.Println(resp, err) }
Output:
func GetDeptMember ¶
获取部门用户userid列表
See: https://ding-doc.dingtalk.com/doc#/serverapi2/ege851
GET https://oapi.dingtalk.com/user/getDeptMember?access_token=ACCESS_TOKENdeptId=1
Example ¶
package main import ( "fmt" "net/url" "github.com/fastwego/dingding" "github.com/fastwego/dingding/apis/contact/user" ) func main() { var ctx *dingding.App params := url.Values{} resp, err := user.GetDeptMember(ctx, params) fmt.Println(resp, err) }
Output:
func GetOrgUserCount ¶
获取企业员工人数
See: https://ding-doc.dingtalk.com/doc#/serverapi2/ege851
GET https://oapi.dingtalk.com/user/get_org_user_count?access_token=ACCESS_TOKENonlyActive=0
Example ¶
package main import ( "fmt" "net/url" "github.com/fastwego/dingding" "github.com/fastwego/dingding/apis/contact/user" ) func main() { var ctx *dingding.App params := url.Values{} resp, err := user.GetOrgUserCount(ctx, params) fmt.Println(resp, err) }
Output:
func GetUseridByUnionid ¶
根据unionid获取userid
See: https://ding-doc.dingtalk.com/doc#/serverapi2/ege851
GET https://oapi.dingtalk.com/user/getUseridByUnionid?access_token=ACCESS_TOKENunionid=xxx
Example ¶
package main import ( "fmt" "net/url" "github.com/fastwego/dingding" "github.com/fastwego/dingding/apis/contact/user" ) func main() { var ctx *dingding.App params := url.Values{} resp, err := user.GetUseridByUnionid(ctx, params) fmt.Println(resp, err) }
Output:
func InactiveUserGet ¶
未登录钉钉的员工列表
See: https://ding-doc.dingtalk.com/doc#/serverapi2/ege851
POST https://oapi.dingtalk.com/topapi/inactive/user/get?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/dingding" "github.com/fastwego/dingding/apis/contact/user" ) func main() { var ctx *dingding.App payload := []byte("{}") resp, err := user.InactiveUserGet(ctx, payload) fmt.Println(resp, err) }
Output:
func ListByPage ¶
获取部门用户详情
See: https://ding-doc.dingtalk.com/doc#/serverapi2/ege851
GET https://oapi.dingtalk.com/user/listbypage?access_token=ACCESS_TOKENdepartment_id=1
Example ¶
package main import ( "fmt" "net/url" "github.com/fastwego/dingding" "github.com/fastwego/dingding/apis/contact/user" ) func main() { var ctx *dingding.App params := url.Values{} resp, err := user.ListByPage(ctx, params) fmt.Println(resp, err) }
Output:
func SimpleList ¶
获取部门用户
See: https://ding-doc.dingtalk.com/doc#/serverapi2/ege851
GET https://oapi.dingtalk.com/user/simplelist?access_token=ACCESS_TOKENdepartment_id=1
Example ¶
package main import ( "fmt" "net/url" "github.com/fastwego/dingding" "github.com/fastwego/dingding/apis/contact/user" ) func main() { var ctx *dingding.App params := url.Values{} resp, err := user.SimpleList(ctx, params) fmt.Println(resp, err) }
Output:
func Update ¶
更新用户
See: https://ding-doc.dingtalk.com/doc#/serverapi2/ege851
POST https://oapi.dingtalk.com/user/update?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/dingding" "github.com/fastwego/dingding/apis/contact/user" ) func main() { var ctx *dingding.App payload := []byte("{}") resp, err := user.Update(ctx, payload) fmt.Println(resp, err) }
Output:
Types ¶
This section is empty.