zsan
(zakarias)
19 أغسطس 2020، 7:44م
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)
19 أغسطس 2020، 11:54م
2
I believe that @blake wrote that documentation so let’s see what he reckons here.
blake
(Blake Erickson)
20 أغسطس 2020، 12:43ص
3
Yes, if you are using Content-Type: application/json you should send it in like
zsan:
{
"user_field: {
"name": "asdf",
"description": "asdf",
"field_type": "confirm",
"required": true
}
}
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)
20 أغسطس 2020، 8:51ص
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": "الاسم الكامل",
"email": "email@address.com",
"password": "348hqpwfaed",
"username": "اسم المستخدم",
"user_fields": {
"1": "بيانات حقل المستخدم المطلوبة"
}
}
التنسيق أعلاه نجح معي.
هل المستندات صحيحة في هذه الحالة لإنشاء مستخدم جديد؟
إعجاب واحد (1)
blake
(Blake Erickson)
5 ديسمبر 2024، 7:32م
7
لا، كان ذلك لا يزال بتنسيق form-data. قمت بتحديثه لاستخدام json حتى يتطابق المثال مع التنسيق. شكراً لك على إثارة هذا الأمر!
main ← api-docs-custom-fields-user-create
opened 07:15PM - 05 Dec 24 UTC
Since the example specifies json use a json formatted example instead of
form-da… ta.
https://meta.discourse.org/t/161413/5
إعجابَين (2)