Quantcast
Channel: Web services
Viewing all articles
Browse latest Browse all 2361

C# core_moodle_create_user

$
0
0

by Mantas Šedys.  

Hello guys, 

could someone help me with customfields in webservice. I'm using C#.

How to add custom profile  fields in web-service?

My code: https://github.com/Kovinis/Moodle/blob/master/CreateUser


Now I'm adding custom profile fields in url: 

            String postData = String.Format("users[0][username]={0}&users[0][password]={1}&users[0][firstname]={2}&users[0][lastname]={3}&users[0][email]={4}&users[0][customfields][type]={5}&users[0][customfields][value]={6}", user.username, user.password, user.firstname, user.lastname, user.email, company, value);

But it gives an error:

{"exception":"invalid_parameter_exception","errorcode":"invalidparameter","message":"Invalid parameter value detected","debuginfo":"users => Invalid parameter value detected: customfields => Invalid parameter value detected: Only arrays accepted. The bad value is: 'company'"}




Viewing all articles
Browse latest Browse all 2361

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>