スキーマ

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

id
integer

Unique identifier for the resource.

読み取り専用

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

username
string

Login name for the resource.

コンテキスト: edit

name
string

Display name for the resource.

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

first_name
string

First name for the resource.

コンテキスト: edit

last_name
string

Last name for the resource.

コンテキスト: edit

email
string, email

The email address for the resource.

コンテキスト: edit

url
string, uri

URL of the resource.

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

description
string

Description of the resource.

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

nickname
string

The nickname for the resource.

コンテキスト: edit

slug
string

An alphanumeric identifier for the resource.

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

registered_date
date-time

Registration date for the resource.

読み取り専用

コンテキスト: edit

roles
array

Roles assigned to the resource.

コンテキスト: edit

password
string

Password for the resource (never included).

コンテキスト:

capabilities
object

All capabilities assigned to the resource.

読み取り専用

コンテキスト: edit

extra_capabilities
object

Any extra capabilities assigned to the resource.

読み取り専用

コンテキスト: edit

avatar_urls
object

Avatar URLs for the resource.

読み取り専用

コンテキスト: embed, 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

Limit result set to resources with a specific slug.

roles

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

定義

GET /wp/v2/users

リクエスト例

$ curl 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

定義

GET /wp/v2/users/<id>

リクエスト例

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

Userを作成

引数

username

Login name for the resource.

必須: true

name

Display name for the resource.

first_name

First name for the resource.

last_name

Last name for the resource.

email

The email address for the resource.

必須: true

url

URL of the resource.

description

Description of the resource.

nickname

The nickname for the resource.

slug

An alphanumeric identifier for the resource.

roles

Roles assigned to the resource.

password

Password for the resource (never included).

必須: true

定義

POST /wp/v2/users

Userを更新する

引数

username

Login name for the resource.

name

Display name for the resource.

first_name

First name for the resource.

last_name

Last name for the resource.

email

The email address for the resource.

url

URL of the resource.

description

Description of the resource.

nickname

The nickname for the resource.

slug

An alphanumeric identifier for the resource.

roles

Roles assigned to the resource.

password

Password for the resource (never included).

定義

POST /wp/v2/users/<id>

リクエスト例

Userを削除

引数

force

Required to be true, as resource does not support trashing.

reassign

定義

DELETE /wp/v2/users/<id>

リクエスト例

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