zsan
(zakarias)
1
create user field
I see
{
"user_field[name]": "string",
"user_field[description]": "string",
"user_field[field_type": "string",
"user_field[required]": true
}
Are you sure ?
I think it should be something like
{
"user_field: {
"name": "asdf",
"description": "asdf",
"field_type": "confirm",
"required": true
}
}
HAWK
(Hawk)
2
I believe that @blake wrote that documentation so let’s see what he reckons here.
blake
(Blake Erickson)
3
Yes, if you are using Content-Type: application/json you should send it in like
The example in the api docs is using Content-Type: multipart/form-data, but I’ll be sure to update it to the json example.
2 个赞
zsan
(zakarias)
4

Thank you @blake
Note:
The problem is … i see application/json in the example (so that’s why my partner spent all hours to figure it out how to use this call)
2 个赞
我也为此苦苦挣扎了大约 24 小时,因为文档示例建议为创建新用户格式化为 application/json 请求,将 user_field 设置为布尔值……
我被告知我没有填写所有必需的用户字段……但在我的例子中,我有一个现有的必需 user_field,我需要向该字段输入数据,并且它应该格式化如下:
{
"name": "Full Name",
"email": "email@address.com",
"password": "348hqpwfaed",
"username": "UserName",
"user_fields": {
"1": "Required User Field Data"
}
}
上面的格式对我来说是有效的。
文档在创建新用户方面是否正确?
1 个赞
blake
(Blake Erickson)
7
不,那仍然是 form-data 格式。我已将其更新为使用 json,以便示例与格式匹配。感谢您提出这个问题!
2 个赞