LBat
July 27, 2017, 4:34pm
1
Hello,
I try to update “user_custom” records.
I go to “API DOCS” menu option, and in the:
PATCH /user/custom
with the payload:
{ "resource": [
{
"id": 279,
"user_id": 1,
"name": "nif",
"value": "000111000"
}
]
}
I verify the table in the database and the record exists, the intention is to change the “value: ‘000000000’” to the new value: “value: ‘000111000’”.
When I call the request (in API DOCS), get this response:
**Request URL**
http://developer.mygreatsite.com/api/v2/user/custom
**Response Body**
{
"error": {
"code": 1000,
"context": {
"error": [
0
],
"resource": [
{
"code": 404,
"context": null,
"message": "Record with identifier '279' not found.",
"status_code": 404
}
]
},
"message": "Batch Error: Not all requested records could be updated.",
"status_code": 500
}
}
This is a DF issue or other problem?!
Any help?!
Best regards,
LB
LBat
July 27, 2017, 9:12pm
2
Hello,
I get a reply on github about this topic:
opened 04:37PM - 27 Jul 17 UTC
closed 11:33PM - 27 Jul 17 UTC
Hello,
I try to update “user_custom” records.
I go to “API DOCS” menu opti… on, and in the:
`PATCH /user/custom`
with the payload:
```
{ "resource": [
{
"id": 279,
"user_id": 1,
"name": "nif",
"value": "000111000"
}
]
}
```
I verify the table in the database and the record exists, the intention is to change the “value: ‘000000000’” to the new value: “value: ‘000111000’”.
When I call the request (in API DOCS), get this response:
```
**Request URL**
http://developer.mygreatsite.com/api/v2/user/custom
**Response Body**
{
"error": {
"code": 1000,
"context": {
"error": [
0
],
"resource": [
{
"code": 404,
"context": null,
"message": "Record with identifier '279' not found.",
"status_code": 404
}
]
},
"message": "Batch Error: Not all requested records could be updated.",
"status_code": 500
}
}
```
This is a DF issue or other problem?!
Any help?!
Best regards,
LB
Resume:
user/custom is for storing name-value pairs for the current user. There is no ‘id’ field exposed via the API. Use POST to create or update a value as described here.
Managing user custom data - DreamFactory
But not tell how change a specific field for the logged user!
Humm, I will try with the “filter” param in the endpoint url.
Regards,
LB
LBat
July 28, 2017, 9:07am
3
Hello again,
To make an update of a value, I get a new answer about this topic:
https://github.com/dreamfactorysoftware/dreamfactory/issues/156#issuecomment-318434658
Best regards,
LB