# Purpose of maapi\_get\_elem

**URL:** <https://dmap-community.ductus.global/t/purpose-of-maapi-get-elem/905>\
**Category:** Core Engine and APIs\
**Created:** [December 27, 2016, 4:58am UTC](https://dmap-community.ductus.global/t/purpose-of-maapi-get-elem/905 "2016-12-27T04:58:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shant](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@shant](https://dmap-community.ductus.global/u/shant)\
**Post date:** [December 27, 2016, 4:58am UTC](https://dmap-community.ductus.global/t/purpose-of-maapi-get-elem/905/1 "2016-12-27T04:58:04Z")

</div>

what is the purpose of this api ? is there any documentation that explains each of the apis ?

---

<div class="post-metadata">

**Author:** ![mnovak](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/mnovak/32/183_2.png) [@mnovak](https://dmap-community.ductus.global/u/mnovak)\
**Post date:** [January 2, 2017, 9:22am UTC](https://dmap-community.ductus.global/t/purpose-of-maapi-get-elem/905/2 "2017-01-02T09:22:48Z")

</div>

Hello,

the `maapi_get_elem` is explained in the `man` pages or in the ConffD user Guide, section `confd_lib_maapi`.

_From ConfD User Guide:_

```auto
int maapi_get_elem(int sock, int thandle, confd_value_t *v, const char *fmt, ...);

```

This reads a value from the path in `fmt` and writes the result into the result parameter `confd_value_t`. The path must lead to a leaf node in the data tree. Note that for the `C_BUF`, `C_BINARY`,`C_LIST`, `C_OBJECTREF`, `C_OID`, `C_QNAME`, and `C_HEXSTR` confd\_value\_t types the buffer(s) pointed to are allocated using `malloc(3)`, it is up to the user of this interface to free them using `confd_free_value()`.
