スキーマ
スキーマはuserオブジェクトに存在するすべてのフィールドを定義しています。
id integer |
Unique identifier for the user. 読み取り専用 コンテキスト: |
username string |
Login name for the user. コンテキスト: |
name string |
Display name for the user. コンテキスト: |
first_name string |
First name for the user. コンテキスト: |
last_name string |
Last name for the user. コンテキスト: |
email string, email |
The email address for the user. コンテキスト: |
url string, uri |
URL of the user. コンテキスト: |
description string |
Description of the user. コンテキスト: |
link string, uri |
Author URL of the user. 読み取り専用 コンテキスト: |
locale string |
Locale for the user. コンテキスト: 次のいずれか: |
nickname string |
The nickname for the user. コンテキスト: |
slug string |
An alphanumeric identifier for the user. コンテキスト: |
registered_date string, datetime (ISO8601) |
Registration date for the user. 読み取り専用 コンテキスト: |
roles array |
Roles assigned to the user. コンテキスト: |
password string |
Password for the user (never included). コンテキスト: |
capabilities object |
All capabilities assigned to the user. 読み取り専用 コンテキスト: |
extra_capabilities object |
Any extra capabilities assigned to the user. 読み取り専用 コンテキスト: |
avatar_urls object |
Avatar URLs for the user. 読み取り専用 コンテキスト: |
meta object |
Meta fields. コンテキスト: |
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.
初期値: 次のいずれか: |
page |
Current page of the collection.
初期値: |
per_page |
Maximum number of items to be returned in result set.
初期値: |
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.
初期値: 次のいずれか: |
orderby |
Sort collection by object attribute.
初期値: 次のいずれか: |
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. 次のいずれか: |
定義
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.
初期値: 次のいずれか: |
定義
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. 次のいずれか: |
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. 次のいずれか: |
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>