insertmicroapprow

description

Add a new row to a Microapp

parameters

ignoreActionRules - this tells the insert code not to fire any of the rules set up in the microapp for when the row is inserted

The X-Auth-Token and X-User-Id are derived from the values authToken and userId returned from the login endpoint and are used in the HTTP header.

rowData - name value pairs for fields.

userID - optional - if not provided, this defaults ot the user making the API call. Optionally, you can set the creator of a row by using the userID (string). eg "userID": "<some user's id>"

resource

{
	"microAppID":<insert microapp id here>",
	"rowData":{
		"ExampleFieldName":"ExampleValue"
	},
	"ignoreActionRules":true
}

response

Returns the status of the request

example

POST /api/insertmicroapprow
X-Auth-Token: <the authtoken you got back after authentication>
X-User-Id: <the userid you got back after authentication>

{
	"rowID":"9860757f2bf858439ed9cc3e",
	"rowData":{
		"Name":"Fred"
	}
}

You should get back:

{
    "status": "success",
}

Linked Table Field Example

When inserting a row with a linked table (cross app) field, you need to provide both the crossAppRowID (the ID of the row you're linking to) and a value object containing the display information.

POST /api/insertmicroapprow
X-Auth-Token: <the authtoken you got back after authentication>
X-User-Id: <the userid you got back after authentication>

{
    "microAppID": "your-microapp-id",
    "rowData": {
        "organizationName": "Acme Corp",
        "marketplaceListing": {
            "crossAppRowID": "marketplace-listing-row-id",
            "value": {
                "label": "listingName",
                "value": "AI Customer Support Solution"
            }
        },
        "assignedUser": {
            "crossAppRowID": "user-row-id", 
            "value": {
                "label": "name",
                "value": "John Smith"
            }
        }
    }
}

Key Points:

  • crossAppRowID: The _id of the row in the linked table

  • value.label: The field name from the linked table to display

  • value.value: The actual display value from that field

You should get back:

{
    "status": "success",
    "rowID": "newly-created-row-id"
}

See Also


Last updated