0

I have the metadata of all the required fields and modules/levels. I'm trying to use the REST API's content/contentid to get details on a single record. When I make a call and use the ID for that record (ticket number) it doesn't return anything.

However, if I go to the record in the GUI, examine the HTML and search for contentid I find a completely unrelated string. If I input that string into the API call it returns that record.

When I search with that contentID, the output contains

"RequestedObject": {
   "Id": X,
   "LevelId": Y,
   "SequentialId": Z,
} 

Where "ID":X is what seems like a randomly generated number, and "SequentialId":Z is what is the identifier for the record.

If I look at the metadata for the fields, the ticket number has the "IsKey":True value. No other fields have that.

Any suggestions would be helpful.

cam
  • 1
  • 2

2 Answers2

1

With the APIs the ContentID is the value from the Tracking Id field (configured as System ID).

Then when you call /api/core/content/ append the tracking/content id to the end like so, /api/core/content/12345

The json you get back will show

{
  "Links": [],
  "RequestedObject": {
    "Id": 12345,
    "LevelId": 41,
    "SequentialId": 1,
    "FieldContents": {
      "50": {
        "Type": 6,
        "FieldId": 50,
        "UpdateInformation": {
          "CreateDate": null,
          "UpdateDate": null,
          "CreateLogin": null,
          "UpdateLogin": null
        }
      },
      ....
}

"Id:" would show the same tracking/content id that you supplied to the API.

Then under "FieldContents:" contains all the fields in the application and their associated data.

DjP
  • 308
  • 1
  • 6
  • I'm trying to set up some sort of automated way to pull these records, the problem is that the ContentID/TrackingID are randomly generated numbers. The 'SequentialID' is the ticket number which is what I'm assuming should be the ContentID/TrackingID. I'm not the Archer admin in my org so I don't really have all this information – cam Mar 29 '19 at 12:22
  • Unfortunately no, the `SequentialID` plays no part in anything worthwhile. The Content/Tracking ID aren't random per-say but are generated across all of Archer Content, so there's no predictability. You can run the Web Services API and generate a report of records with their associated Content/Tracking ID and pass the ids from the report to the REST APIs and go from there. – DjP Mar 29 '19 at 14:15
  • Thank you for the help, I was able to get the Archer admin to add the Content/Tracking ID as a visible value for the records, I can also now see it when I use the SOAP executeSearch. – cam Apr 03 '19 at 16:59
0

If you're dead set on using the REST api, you should probably take a look at your TrackingID. If your Tracking ID is configured as a system ID, that will be your contentID. If your Tracking ID is not set as a system ID (rather it will be limited to be unique to the application), I recommend you add another Tracking ID to your application that is system wide. If you don't want to make any changes, you can still retrieve your contentID, but you'll have to use the WebServices 'ExecuteSearch' call. Just make sure that you're searching on the key field to prevent receiving multiple records in the call. From there you'll get your contentID (in XML) and you can proceed with your REST call as planned.

ArcherHero
  • 31
  • 3
  • Is it possible to pull records using the REST API by the 'SequentialID'? I'm not the Archer admin in my org so adding/removing IDs would be at the bottom of my list. I have used the 'ExecuteSearch' call and retrieved a record, but I don't remember seeing a ContentID. The ContentID was not in the list of fields when I looked up the metadata for the records I'm looking for. – cam Mar 29 '19 at 12:28