hummer
#1
Hi!
Is there an opportunity to set these fields in table cscart_user_profiles through the API?
s_address
s_city
s_country
...
I tried via PUT request...
https://example.com/api/users/248
{
"s_address": "Example street"
}
...but unfortunately without success.
Any hints?
Best regards
hummer
It should work. Try to update any other field (like status)
hummer
#3
Hi!
Try to update any other field (like status)
Unfortunately, adding a field like "Status" didn't work.
Is it randomly which fields are supported by the API and which are not?
I've found that all fields with "b_ *" and "s_ *" are supported, except:
- b_address2
- s_address
- s_address2
- s_city
- s_state
- s_country
- s_zipcode
My API PUT request (the body):
{
"b_firstname": "b_firstname",
"b_lastname": "b_lastname",
"b_address": "b_address",
"b_address2": "b_address2",
"b_city": "b_city",
"b_county": "b_county",
"b_state": "b_state",
"b_country": "b_country",
"b_zipcode": "b_zipcode",
"b_phone": "b_phone",
"s_firstname": "s_firstname",
"s_lastname": "s_lastname",
"s_address": "s_address",
"s_address2": "s_address2",
"s_city": "s_city",
"s_county": "s_county",
"s_state": "s_state",
"s_country": "s_country",
"s_zipcode": "s_zipcode",
"s_phone": "s_phone"
}
Result in the database:
[attachment=14757:profile_update2.PNG]
Any further ideas?
best regards
hummer
profile_update2.PNG
I do not see any restrictions on the fields in the code of API entity
hummer
#5
I do not see any restrictions on the fields in the code of API entity
Ah, thanks for looking into into the code!
Is it a bug then and worth to be reported to the bugtracker?
Try to post it. At least we will see official answer
hummer
#7
Try to post it. At least we will see official answer
I posted it to the bugtracker: https://forum.cs-cart.com/tracker/issue-7890-api-not-all-fields-of-user-profiles-accessible/
As always: thanks, eComLabs!