derpunker Posted August 15, 2017 Posted August 15, 2017 Hello everybody, I've got an problem using the REST-API. I want to update the "customfields" of my members, but it fails. Changing "name", "email",... works fine. I'm using the format described in the documentation (https://invisioncommunity.com/developers/rest-api?endpoint=core/members/POSTitem) and send the request as 'application/x-www-form-urlencoded' (https://invisioncommunity.com/developers/rest-api). I have already created a support ticket asking the exact format for the "customfields". The answer was, Quote "customFields": [ { "XX": "Testwert!" } ] Where 'XX' is the field ID (not the key or human-readable name) of the custom field you wish to set this value for. but it still doesn't work. Here some fiddler logs HEADER POST /api/index.php?/core/members/3 HTTP/1.1 Authorization: Basic xxxxxx Content-Type: application/x-www-form-urlencoded Host: yyyyyyy Content-Length: 53 CONTENT email=test7%40me.de&customFields=[{"11":"TestValue"}] Field 11 exists. The email is accepted and stored in IPS, but not the customfield. In the REST API Log of IPS, I can find the incoming request. REQUEST DATA { "\/core\/members\/3": "", "email": "test7@me.de", "customFields": "[{\"11\":\"TestValue\"}]" } RESPONSE ..... Are there any ideas what's wrong in my request? The partial presponse for an GET request at this member: "customFields": { "1": { .... }, "2": { "name": "Profile Information", "fields": { "11": { "name": "Interests", "value": "default" } } }, .... Thank you in advance
derpunker Posted August 16, 2017 Author Posted August 16, 2017 I got it, the answer of the support was simply misleading. The correct syntax is: "customFields[XX]" : "TestValue!"
Recommended Posts
Archived
This topic is now archived and is closed to further replies.