# Bad path element "password" after: /user

**URL:** <https://dmap-community.ductus.global/t/bad-path-element-password-after-user/4095>\
**Category:** CDB and CDB API\
**Created:** [May 31, 2022, 7:26am UTC](https://dmap-community.ductus.global/t/bad-path-element-password-after-user/4095 "2022-05-31T07:26:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![furkan](https://avatars.discourse-cdn.com/v4/letter/f/278dde/32.png) [@furkan](https://dmap-community.ductus.global/u/furkan)\
**Post date:** [May 31, 2022, 7:26am UTC](https://dmap-community.ductus.global/t/bad-path-element-password-after-user/4095/1 "2022-05-31T07:26:19Z")

</div>

Hi,

I am trying to change user password via maapi and i am having an issue as the following.

The output of execution is below  
**user admin is exists:**  
**2022-05-31T07:21:38.718365427Z TRACE MAAPI\_EXISTS user{admin} → CONFD\_OK**  
**2022-05-31T07:21:38.718753035Z TRACE MAAPI\_GET\_ELEM /user{admin}/passwordDEBUG badly formatted or nonexistent path - Bad path element “password” after: /user**

My code is below and im following confd user guide.

> ```
> maapi_init_cursor(msock, th, &mc, "/aaa/authentication/users");
> 
> if (maapi_exists(msock, th, "user/{%s}", userName) !=CONFD_OK) {
> printf("user %s is not exists:\n", userName);
> fflush(stdout);
> return CONFD_ERR;
> }
> printf("user %s is exists:\n", userName);
> fflush(stdout);
> // Check newPassword and confirmPassword are same
> if (strcmp(newPassword, confirmPassword) != 0) {
> printf("Password confirmation is wrong: %s\n", confd_lasterr());
> return CONFD_ERR;
> }
> 
> // Check old password
> if (maapi_get_str_elem(msock, th, buf, BUFSIZ,
> "/user{%s}/password", userName) == CONFD_OK) {
> if (strcmp(oldPassword, buf) != 0) {
> printf("Old Password is wrong");
> return CONFD_ERR;
> }
> }
> 
> ```

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [May 31, 2022, 9:44am UTC](https://dmap-community.ductus.global/t/bad-path-element-password-after-user/4095/2 "2022-05-31T09:44:17Z")

</div>

Seems like there is a slash “/“ before “user” that should be removed. "/user{%s}/pas…”. Or you need to add the full path “/aaa/authentication/users”.

---

<div class="post-metadata">

**Author:** ![furkan](https://avatars.discourse-cdn.com/v4/letter/f/278dde/32.png) [@furkan](https://dmap-community.ductus.global/u/furkan)\
**Post date:** [May 31, 2022, 10:29am UTC](https://dmap-community.ductus.global/t/bad-path-element-password-after-user/4095/3 "2022-05-31T10:29:01Z")

</div>

Thanks, full path worked.
