@jasal I’m attaching a payload that works successfully for me right now. I’m hoping the formatting doesn’t mangle too badly by pasting it here.
I’ve modeled closely--though not exactly--like the format at Gainsight’s Support documentation here: https://support.gainsight.com/Gainsight_NXT/API_and_Developer_Docs/Timeline_API/Timeline_APIs
Good luck….and Happy Holidays!
POST
https://{DOMAIN_NAME}}.gainsightcloud.com/v1/ant/es/activity
{
"records": >
{
"ContextName": "Company",
"TypeName": "Update",
"ExternalId": “20221229001”,
"Subject": "{{SUBJECT_NAME}}",
"ActivityDate": "2022-12-29T10:08:00.000Z",
"Notes": "Timeline entry created via API",
"author": "{{EMAIL}}",
"companyName": "{{COMPANY_NAME}}"
}
],
"lookups": {
"GsCompanyId": {
"fields": {
"companyName": "Name"
},
"lookupField": "Gsid",
"objectName": "Company",
"multiMatchOption": "FIRSTMATCH",
"onNoMatch": "ERROR"
},
"AuthorId": {
"fields": {
"author": "Email"
},
"lookupField": "Gsid",
"objectName": "GsUser",
"multiMatchOption": "FIRSTMATCH",
"onNoMatch": "ERROR"
}
}
}
Thanks for this! I am creating these entries from a rule so the only thing I am not pulling from a rule is the TypeName and Subject. Where do you pull your external ID from and time without manually entering?
@jasal By all means.
The ExternalID likely comes from your source. That is, if you are receiving data from a 3rd party and transforming / preparing it via Rule for addition to the Timeline, you’ll use a Record ID that the 3rd party provided. If you don’t have one from your source, you’ll need to generate one (it’s a required field) and ensure it’s globally unique. You could CONCAT the Subject and Company and Date, as an idea, to generate something that’s unique. If an ExternalID is a dup, then the record is rejected (though I don’t know what error that rejection throws).
For time, you could manufacture a date/time if your source has a timestamp. It’s not a required field, and if not provided defaults to the current date in UTC.