The CreatorCon Call for Content is officially open! Get started here.

ServiceNow Api

Shravan Kurup
Kilo Contributor

Hello Everyone,

   I have a issue regarding Service now create new account API when i executed API in postman  new account is creating,but i could not login to the new servicenow account.

API:-/api/now/v2/table/sys_user

Body:-

{
    "user_name": "Yaaaash.K",
    "first_name": "Shiv",
    "last_name": "Maheswar",
    "title": "Administrative Assistant",
    "department": "Development",
    "user_password": "Welcome@123",
    "active": "true",
    "email": "yash18@gmail.com",
    "mobile_phone": "958747845",
    "roles": "rest_service,web_service_admin,admin",
    "password_needs_reset": "true"
}
   
1 ACCEPTED SOLUTION

Hitoshi Ozawa
Giga Sage
Giga Sage

Hi Shravan,

Department is a reference field to cmn_department table so sys_id needs to be specified instead of department name.

Password, also, can not be set by API.

Roles is in a different table name sys_user_has_role so a different api call needs to be made.

View solution in original post

2 REPLIES 2

Hitoshi Ozawa
Giga Sage
Giga Sage

Hi Shravan,

Department is a reference field to cmn_department table so sys_id needs to be specified instead of department name.

Password, also, can not be set by API.

Roles is in a different table name sys_user_has_role so a different api call needs to be made.

Creating an user from API and then having an admin set the password from web browser will allow the user to login.