スキーマ

スキーマはuserオブジェクトに存在するすべてのフィールドを定義しています。

id
integer

Unique identifier for the user.

読み取り専用

コンテキスト: embed, view, edit

username
string

Login name for the user.

コンテキスト: edit

name
string

Display name for the user.

コンテキスト: embed, view, edit

first_name
string

First name for the user.

コンテキスト: edit

last_name
string

Last name for the user.

コンテキスト: edit

email
string, email

The email address for the user.

コンテキスト: edit

url
string, uri

URL of the user.

コンテキスト: embed, view, edit

description
string

Description of the user.

コンテキスト: embed, view, edit

locale
string

Locale for the user.

コンテキスト: edit

次のいずれか: , en_US

nickname
string

The nickname for the user.

コンテキスト: edit

slug
string

An alphanumeric identifier for the user.

コンテキスト: embed, view, edit

registered_date
string, datetime (ISO8601)

Registration date for the user.

読み取り専用

コンテキスト: edit

roles
array

Roles assigned to the user.

コンテキスト: edit

password
string

Password for the user (never included).

コンテキスト:

capabilities
object

All capabilities assigned to the user.

読み取り専用

コンテキスト: edit

extra_capabilities
object

Any extra capabilities assigned to the user.

読み取り専用

コンテキスト: edit

avatar_urls
object

Avatar URLs for the user.

読み取り専用

コンテキスト: embed, view, edit

meta
object

Meta fields.

コンテキスト: view, edit

Example Request

$ curl -X OPTIONS -i http://demo.wp-api.org/wp-json/wp/v2/users

User一覧

引数

context

Scope under which the request is made; determines fields present in response.

初期値: view

次のいずれか: view, embed, edit

page

Current page of the collection.

初期値: 1

per_page

Maximum number of items to be returned in result set.

初期値: 10

search

Limit results to those matching a string.

exclude

Ensure result set excludes specific IDs.

初期値:

include

Limit result set to specific IDs.

初期値:

offset

Offset the result set by a specific number of items.

order

Order sort attribute ascending or descending.

初期値: asc

次のいずれか: asc, desc

orderby

Sort collection by object attribute.

初期値: name

次のいずれか: id, include, name, registered_date, slug, include_slugs, email, url

slug

Limit result set to users with one or more specific slugs.

roles

Limit result set to users matching at least one specific role provided. Accepts csv list or single role.

who

Limit result set to users who are considered authors.

次のいずれか: authors

定義

GET /wp/v2/users

リクエスト例

$ curl http://demo.wp-api.org/wp-json/wp/v2/users

Userを取得する

引数

id

Unique identifier for the user.

context

Scope under which the request is made; determines fields present in response.

初期値: view

次のいずれか: view, embed, edit

定義

GET /wp/v2/users/<id>

リクエスト例

$ curl http://demo.wp-api.org/wp-json/wp/v2/users/<id>

Userを作成

引数

username

Login name for the user.

必須: true

name

Display name for the user.

first_name

First name for the user.

last_name

Last name for the user.

email

The email address for the user.

必須: true

url

URL of the user.

description

Description of the user.

locale

Locale for the user.

次のいずれか: , en_US

nickname

The nickname for the user.

slug

An alphanumeric identifier for the user.

roles

Roles assigned to the user.

password

Password for the user (never included).

必須: true

meta

Meta fields.

定義

POST /wp/v2/users

Userを更新する

引数

id

Unique identifier for the user.

username

Login name for the user.

name

Display name for the user.

first_name

First name for the user.

last_name

Last name for the user.

email

The email address for the user.

url

URL of the user.

description

Description of the user.

locale

Locale for the user.

次のいずれか: , en_US

nickname

The nickname for the user.

slug

An alphanumeric identifier for the user.

roles

Roles assigned to the user.

password

Password for the user (never included).

meta

Meta fields.

定義

POST /wp/v2/users/<id>

リクエスト例

Userを削除

引数

id

Unique identifier for the user.

force

Required to be true, as users do not support trashing.

reassign

Reassign the deleted user's posts and links to this user ID.

必須: true

定義

DELETE /wp/v2/users/<id>

リクエスト例

$ curl -X DELETE http://demo.wp-api.org/wp-json/wp/v2/users/<id>