Create contact via API | MDaemon Technologies, Ltd.

Create contact via API


  • Hello,

    Trying to create a new Contact in a public folder path using the API. How are you supposed to craft the CID? It seems entirely random to me and there's no explanation of it anywhere. I am getting "The XML is malformed" whenever I try to create a contact via the API.

    <?xml version="1.0"?>
    <MDaemon>
        <API serviceversion="24.5.0.1" productversion="24.5.0">
            <Request version="24.5" echo="0" verbose="0">
                <Operation>ItemOperation</Operation>
                <Parameters>
                    <Item path="PUBLIC/domain.com" type="contact" action="put" cid="2025-02-27_03:42:42.921">
                        <FirstName>Test</FirstName>
                        <LastName>ContactCreate</LastName>
                        <DisplayName>Test Contact Create</Displayname>
                        <Email1Address>test@domain.com</Email1Address>
                    </Item>
                </Parameters>
            </Request>
        </API>
    </MDaemon>


  • The CID is a client ID for the item. You can assign any value that you'd like but it should be unique for each item.  

    Assuming the public folder name is Contacts, the <Item> element should look like this:

    <Item path="PUBLIC/domain.com/Contacts" type="contact" action="put" cid="2025-02-27_03:42:42.921">
    

    And the system is case sensitive.  Change </Displayname> to </DisplayName>


Please login to reply this topic!