curl --request POST \
--url https://api-{dc}.moengage.com/v1.0/custom-templates/inapp \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"basic_details": {
"payload": "{'jsonKey': 'jsonValue', 'title': 'hello world'}",
"inapp_template_type": "SELF_HANDLED"
},
"meta_info": {
"created_by": "test@example.com",
"template_id": "self_handled_123",
"template_name": "My Self-Handled Template",
"template_version": "1"
}
}
EOF{
"external_template_id": "4a1afbc5-4c31-4f19-8c23-793e27af01aa"
}{
"error": {
"code": "400 Bad Request",
"message": "Validation failed because of invalid request data",
"details": [
{
"code": "MissingValue",
"target": "template_id",
"message": "template_id value is required but value is passed empty."
}
],
"request_id": "NpiintyO"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"code": "<string>",
"target": "<string>",
"message": "<string>"
}
],
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"code": "<string>",
"target": "<string>",
"message": "<string>"
}
],
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"code": "<string>",
"target": "<string>",
"message": "<string>"
}
],
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"code": "<string>",
"target": "<string>",
"message": "<string>"
}
],
"request_id": "<string>"
}
}Create In-app Template
This API creates an In-app template in MoEngage. You can use this API to upload templates created outside the MoEngage ecosystem to MoEngage and use them for campaign creation.
curl --request POST \
--url https://api-{dc}.moengage.com/v1.0/custom-templates/inapp \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"basic_details": {
"payload": "{'jsonKey': 'jsonValue', 'title': 'hello world'}",
"inapp_template_type": "SELF_HANDLED"
},
"meta_info": {
"created_by": "test@example.com",
"template_id": "self_handled_123",
"template_name": "My Self-Handled Template",
"template_version": "1"
}
}
EOF{
"external_template_id": "4a1afbc5-4c31-4f19-8c23-793e27af01aa"
}{
"error": {
"code": "400 Bad Request",
"message": "Validation failed because of invalid request data",
"details": [
{
"code": "MissingValue",
"target": "template_id",
"message": "template_id value is required but value is passed empty."
}
],
"request_id": "NpiintyO"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"code": "<string>",
"target": "<string>",
"message": "<string>"
}
],
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"code": "<string>",
"target": "<string>",
"message": "<string>"
}
],
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"code": "<string>",
"target": "<string>",
"message": "<string>"
}
],
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"code": "<string>",
"target": "<string>",
"message": "<string>"
}
],
"request_id": "<string>"
}
}Authorizations
Authentication is done via Basic Auth. This requires a base64-encoded string of your credentials in the format 'username:password'.
- Username: Use your MoEngage workspace ID (also known as the App ID). You can find it in the MoEngage dashboard at Settings > Account > APIs > Workspace ID (earlier app id).
- Password: Use your API Key, which you can find within the Campaign report/Business events/Custom templates/Catalog API/Inform Report tile.
For more information on authentication and getting your credentials, refer here.
Body
The details of the In-app template to be created.
This field contains details about the template to be created, including its payload and template type.
Show child attributes
Show child attributes
This field contains information about the template being created, such as its name, version, and ID and the creator's details.
Show child attributes
Show child attributes
Response
Template created successfully.
This field contains the unique ID corresponding to a successful custom template creation. This template ID is used as header input for update, search, or any kind of template modifications in later stage.
"4a1afbc5-4c31-4f19-8c23-793e27af01aa"
Was this page helpful?