user

package
v1.0.0-beta.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package user 通讯录/用户管理

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(ctx *dingding.App, payload []byte) (resp []byte, err error)

创建用户

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

func Delete(ctx *dingding.App, params url.Values) (resp []byte, err error)

删除用户

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

func Get(ctx *dingding.App, params url.Values) (resp []byte, err error)

获取用户详情

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

func GetAdmin(ctx *dingding.App) (resp []byte, err error)

获取管理员列表

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

func GetAdminScope(ctx *dingding.App) (resp []byte, err error)

获取管理员通讯录权限范围

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

func GetByMobile(ctx *dingding.App, params url.Values) (resp []byte, err error)

根据手机号获取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

func GetDeptMember(ctx *dingding.App, params url.Values) (resp []byte, err error)

获取部门用户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

func GetOrgUserCount(ctx *dingding.App, params url.Values) (resp []byte, err error)

获取企业员工人数

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

func GetUseridByUnionid(ctx *dingding.App, params url.Values) (resp []byte, err error)

根据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

func InactiveUserGet(ctx *dingding.App, payload []byte) (resp []byte, err error)

未登录钉钉的员工列表

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

func ListByPage(ctx *dingding.App, params url.Values) (resp []byte, err error)

获取部门用户详情

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

func SimpleList(ctx *dingding.App, params url.Values) (resp []byte, err error)

获取部门用户

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

func Update(ctx *dingding.App, payload []byte) (resp []byte, err error)

更新用户

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL