﻿<h3>Create new record from email</h3>


<pre><code class="bash">
    # Here is a curl example
    curl \
    -X POST "http://localhost:8888/api/PropertyCard/CreateNewRecordFromEmail" \
    -H "Authorization: {token}" \
    -H "Content-Type: application/json" \
    -d '{
            "object_id": 123,
            "sub_object_guid":"test",
            "field_group_id":123,
            "keep_checked_out":false,
            "emails":[{
                     "subject":"test",
                     "body":"test",
                     "from":"test",
                     "to":"test",
                     "cc":"test"
                     "sent_date":"10/10/2026",
                     "received_date":"10/10/2026",
                     "size":0,
                     "email_data":[],
                     "attachments":[{
                         "attachment_name":"test",
                         "attachment_data":[],
                        }]
                 }]
        }'
</code></pre>

<p>
    This method allows you to create new record across multiple objects in the system.
</p>
<p>
    To create a new record from an Outlook email into one or more existing object records, make a POST request to the following endpoint
    :<br />
     <code class="higlighted break-word">http://localhost:8888/api/PropertyCard/CreateNewRecordFromEmail</code>
</p>
<br />

<pre><code class="json">
    Result example :
    [
        {
            "Success": "boolean",
            "Message": "string",
            "Data": object,
            "CustomAction": Dictionary&lt;object, object&gt; ,
            "CustomAttributes":Dictionary&lt;object, object&gt;
        }
    ]
</code></pre>

<h4>From Body Parameters</h4>
<table class="central-overflow-x">
    <thead>
        <tr>
            <th>Field</th>
            <th>Parameter Type</th>
            <th>Type</th>
            <th>Description</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>object_id</td>
            <td>body</td>
            <td>long</td>
            <td>
                Object Id.
            </td>
        </tr>
        <tr>
            <td>sub_object_guid</td>
            <td>body</td>
            <td>string</td>
            <td>
                Sub Object Guid
            </td>
        </tr>
        <tr>
            <td>field_group_id</td>
            <td>body</td>
            <td>long</td>
            <td>
                Folder Id. You can get from another method
                (http://localhost:8888/api/Objects/ObjectFieldGroupsByObjectId).
            </td>
        </tr>
        <tr>
            <td>keep_checked_out</td>
            <td>body</td>
            <td>boolean</td>
            <td>
                Keep Checked Out  (Optional - default false).
            </td>
        </tr>
        
        <tr>
            <td>emails</td>
            <td>body</td>
            <td>List&lt;CreateNewEmailDataParameters&gt;</td>
            <td>
                CreateNewEmailDataParameters. Is an class with properties
                <br />
                email_id: string  <br />
                internal_message_id: string  <br />
                conversation_id: string  <br />
                subject: string  <br />
                body: string  <br />
                from: string  <br />
                to: string  <br />
                cc: string  <br />
                sent_date: string  <br />
                received_date: string  <br />
                size: int  <br />
                email_data:byte[],
                attachments:>List&lt;CreateNewEmailAttachmentDataParameters&gt;
                <br />
                The value of single  field should be
                <br />
                sample: <br />
                {
                "email_id":"test", <br />
                "internal_message_id":"test", <br />
                "conversation_id":"test", <br />
                "subject":"test", <br />
                "body":"test" <br />
                "from":"test", <br />
                "to":"test" <br />
                "cc":"test", <br />
                "sent_date":"10/10/2026", <br />
                "received_date":"10/10/2026", <br />
                "size":12, <br />
                "email_data":[], <br />
                "attachments":[{ <br />
                "attachment_name":"test", <br />
                "attachment_data":byte [] <br />
                }] <br />
                }
            </td>
        </tr>
        <tr>
            <td>attachments</td>
            <td>body</td>
            <td>List&lt;CreateNewEmailAttachmentDataParameters&gt;</td>
            <td>
                CreateNewEmailAttachmentDataParameters. Is an class with properties
                <br />
                attachment_name: string  <br />
                body: string  <br />
                attachment_data:byte[]
                <br />
                The value of single  field should be
                <br />
                sample: <br />
                {
                "attachment_name":"test", <br />
                "attachment_data":byte [] <br />
                }
            </td>
        </tr>
        <tr>
            <td>Authorization</td>
            <td>header</td>
            <td>string</td>
            <td>Add Authorization header token</td>
        </tr>
    </tbody>
</table>
