Question

External API Errors

  • 27 December 2022
  • 3 replies
  • 166 views

Badge

Hi all,

I have exhausted every article in Community and on GS Support, as well as reaching out to Support directly on this issue. 

I have been struggling with the Timeline POST API for a few weeks, I have tried modifying my payload a number of ways and consistently get this error:

 

  "code": -701,

  "error": "DB_EXCEPTION",

  "message": "DB exception occured.",

  "breakingNews": "Sql exception occurred while processing",

  "data": null,

  "path": "null",

  "status": 500

 

I do have someone from the GS who will be troubleshooting this starting January 3rd, but I am curious if anyone has an example payload (not response) for posting external information onto the Timeline as a specific activity.

 

Thanks!


3 replies

Userlevel 7
Badge +9

@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"

    }

  }

}

 

Badge

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?

Userlevel 7
Badge +9

@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.

Reply