Endpoints
Details
Details is a way to get all information needed to perform actions on a resource. It will give you the current state of the resource depending on the user.
How to use it
When you are ready to get the details, you can use the details
method by making a GET call:
// (GET) api/users
Response
As a response, you'll receive the resource details:
{
"data": {
"actions": [
{
"name": "Send Welcome Notification",
"uriKey": "send-welcome-notification",
"fields": {
"delay": [
"required",
"numeric"
]
},
"meta": {
"color": "#FFFFFF"
},
"is_standalone": false
}
],
"instructions": [
{
"name": "Odd Even Id",
"uriKey": "odd-even-id",
"fields": {
"type": [
"in:odd,even"
]
},
"meta": {
"color": "#FFFFFF"
}
}
],
"fields": [
"id",
"name"
],
"limits": [
1,
10,
25,
50
],
"scopes": [
"withTrashed"
],
"relations": [
{
"resources": [
"App\\Rest\\Resources\\UserResource"
],
"relation": "posts",
"constraints": {
"required_on_creation": false,
"prohibited_on_creation": false,
"required_on_update": false,
"prohibited_on_update": false
},
"name": "HasMany"
}
],
"rules": {
"all": {"id": ["numeric"]},
"create": {"password": ["required"]},
"update": {"password": ["prohibited"]}
}
}
}
Keep in mind that these details are really helpful because, in some way, some data won't be exposed such as fields / actions / instructions depending on the user's rights and backend configuration.
uriKey
is the data to specify when making operations. It's a unique identifier in string format also known as slug.