スキーマ
スキーマはuserオブジェクトに存在するすべてのフィールドを定義しています。
idinteger |
Unique identifier for the user. 読み取り専用 コンテキスト: |
usernamestring |
Login name for the user. コンテキスト: |
namestring |
Display name for the user. コンテキスト: |
first_namestring |
First name for the user. コンテキスト: |
last_namestring |
Last name for the user. コンテキスト: |
emailstring, email |
The email address for the user. コンテキスト: |
urlstring, uri |
URL of the user. コンテキスト: |
descriptionstring |
Description of the user. コンテキスト: |
linkstring, uri |
Author URL of the user. 読み取り専用 コンテキスト: |
localestring |
Locale for the user. コンテキスト: 次のいずれか: |
nicknamestring |
The nickname for the user. コンテキスト: |
slugstring |
An alphanumeric identifier for the user. コンテキスト: |
registered_datestring, datetime (ISO8601) |
Registration date for the user. 読み取り専用 コンテキスト: |
rolesarray |
Roles assigned to the user. コンテキスト: |
passwordstring |
Password for the user (never included). コンテキスト: |
capabilitiesobject |
All capabilities assigned to the user. 読み取り専用 コンテキスト: |
extra_capabilitiesobject |
Any extra capabilities assigned to the user. 読み取り専用 コンテキスト: |
avatar_urlsobject |
Avatar URLs for the user. 読み取り専用 コンテキスト: |
metaobject |
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>