I need to create a user with API
Creating a User with API
Collapse
X
-
Just check how it is done from the request tab in your browser, you have to make a post request to user api
Example
Code:fetch("http://mycrm.com/espocrm/api/v1/User", { "headers": { "accept": "application/json, text/javascript, */*; q=0.01", "accept-language": "en-US;q=0.8,en;q=0.7", "content-type": "application/json", "espo-authorization-by-token": "true", "x-requested-with": "XMLHttpRequest" }, "referrer": "http://mycrm.com/espocrm/", "referrerPolicy": "strict-origin-when-cross-origin", "body": "{\"type\":\"regular\",\"isActive\":true,\"teams\":{\"teamsIds\":[]},\"userName\":\"test\",\"salutationName\":null,\"firstName\":\"firstName\",\"lastName\":\"LastName\",\"name\":\"firstName LastName\",\"title\":null,\"emailAddressData\":[{\"emailAddress\":\"test@testmail.com\",\"primary\":true,\"optOut\":false,\"invalid\":false,\"lower\":\"test@testmail.com\"}],\"emailAddress\":\"test@testmail.com\",\"emailAddressIsOptedOut\":false,\"gender\":\"Male\",\"defaultTeamName\":null,\"defaultTeamId\":null,\"rolesIds\":[],\"rolesNames\":{},\"passwordInfo\":null,\"phoneNumberData\":[],\"phoneNumber\":null,\"phoneNumberIsOptedOut\":null,\"password\":\"123\",\"passwordConfirm\":\"123\",\"teamsIds\":[],\"teamsNames\":{},\"teamsColumns\":{},\"sendAccessInfo\":true,\"passwordPreview\":\"\"}", "method": "POST", "mode": "cors", "credentials": "include" });
-
user Api does not have permission to create a user -
I am sorry, it worked for me using the console.
Maybe this topic could help you https://forum.espocrm.com/forum/deve...-create-a-user
-
Comment