How to generate task ID for migrate package in Xl-deploy?

while doing a migration from xl-deploy Application UI, I could see the task ID on the UI side. In a similar way how we can generate task id from XLD REST API? And I copied task ID from XL-deploy Application side, using Rest API I can able to migrate the Application.

Yes, the task id is generated automatically, even if you use the rest api to create a task:
curl -u: -X POST -H “content-type:application/xml” http://:/deployit/deployment/ -d@/tmp/deployment-spec.xml

Content as xml as example:

<deployment id="deployment-c90ec677-0be2-49bf-906f-650766740c36" type="INITIAL">
    <application>
        <udm.DeployedApplication id="Environments/Dev/TEST/PetPortal">
            <version ref="Applications/PetPortal/1.0"/>
            <environment ref="Environments/Dev/TEST"/>
            <deployeds/>
            <orchestrator/>
            <optimizePlan>true</optimizePlan>
        </udm.DeployedApplication>
    </application>
    <deployeds>
        <sql.ExecutedSqlScripts id="Infrastructure/Dev/Database-1/MySql/sql">
            <deployable ref="Applications/PetPortal/1.0/sql"/>
            <container ref="Infrastructure/Dev/Database-1/MySql"/>
            <placeholders/>
        </sql.ExecutedSqlScripts>
        <jbossas.EarModule id="Infrastructure/Dev/Appserver-1/JBoss/PetClinic-ear">
            <deployable ref="Applications/PetPortal/1.0/PetClinic-ear"/>
            <container ref="Infrastructure/Dev/Appserver-1/JBoss"/>
            <placeholders/>
        </jbossas.EarModule>
    </deployeds>
    <deployables>
        <ci ref="Applications/PetPortal/1.0/PetClinic-ear" type="jee.Ear"/>
        <ci ref="Applications/PetPortal/1.0/sql" type="sql.SqlScripts"/>
    </deployables>
    <containers>
        <ci ref="Infrastructure/Dev/Appserver-1/JBoss" type="jbossas.ServerV5"/>
        <ci ref="Infrastructure/Dev/Database-1/MySql" type="sql.MySqlClient"/>
    </containers>
</deployment>

OUTPUT:bd4aef1c-3a85-4d1a-a839-03ae619d01df

–> this is then your TaskID