API endpoint overview

138 views
Skip to first unread message

Dan Palley

unread,
Apr 8, 2019, 12:46:24 PM4/8/19
to TramsAPI Beta
There have been a few questions recently about what API calls are available and which should be used for what purposes.  I'm going to summarize here very briefly.

The current TramsAppServer API focuses on 5 major areas of functionality: Profile, ResCard, Invoice, Payment, Activity.  Within each of these areas, there are endpoints for querying,loading,  inserting, and updating records of these types.

The query endpoints are named with the area, i.e. Profile, and the word query and then /runquery, like this:  


Each of the query endpoints takes a varying number of parameters.  To see the parameters, use 


Queries return a summary of data for 0 or more records and do not return all data related to the records.  Typically, the query endpoints are used to search for a particular record.

The load endpoint returns a complete copy of the record including all child records.  The load endpoint typically only takes one parameter: the record number you want to load.

To load a record, specify the area name and then /load/xx where xx is the record number of the record you want to load.  For example, to load profile #5, you'd use 


To insert and update records, use /applyupdates.  ApplyUpdates requires that you post a delta dataset in JSON format that contains the changes to the record for an update or the new values for an insert.

The format of the delta dataset is somewhat complicated and a bit hard to explain in a post.  We'll be updating the documentation with more details; there are some samples of updates here in the forum

Dan

Douglas Hammond

unread,
Apr 8, 2019, 1:38:34 PM4/8/19
to TramsAPI Beta
Thank that clarification helps.

I have tried the http://localhost:8085/profile/load/xxx yet I get no data returned for for the profile.  I get the metadata.

Dan Palley

unread,
Apr 8, 2019, 7:47:15 PM4/8/19
to TramsAPI Beta
Hi Doug,

Just tested and it worked for me.  Are you sure the profile number you specified is valid?

Dan

Douglas Hammond

unread,
Apr 9, 2019, 8:57:42 AM4/9/19
to TramsAPI Beta
Yes,  I have tried a whole series of number from the userprofileno from the userprofile table in the database and none of them return more then just metadata.  Even for 1 which is SYSDBA.

Dan Palley

unread,
Apr 9, 2019, 11:44:25 AM4/9/19
to TramsAPI Beta
Hi Doug,

There's a difference between profile and userprofile.  UserProfile is a special case because there are different ways to load the record (by username, by userprofileno, etc).

UserProfile is not a table we're really supporting in the initial release of the API, since it's not common for customers to update directly, however it is accessible via the API.

You can use the parameterized load instead.

Can you give me an idea of what you want to do with user profiles?

Dan

Douglas Hammond

unread,
Apr 9, 2019, 2:45:57 PM4/9/19
to TramsAPI Beta
An example of the parameterized request would be greatly appreciated.

We want to sync with our user directory.  For example sync our
userSecurityLevel group based on our internal groups along with email
addresses and smtp server settings, active/inactive CBOEnabled or not,
etc...  We have a large number of users and manually having to update
multiple systems is a pain.

Would also be nice if UserProfile queries supported searching by the
linked agent profile too.

Douglas Hammond

unread,
Apr 10, 2019, 11:25:22 AM4/10/19
to TramsAPI Beta
I seem to have this working now except I have to query instead of load the userProfle.

Would be great if userProfle/load could be updated the future.

Dan Palley

unread,
Apr 11, 2019, 1:55:39 PM4/11/19
to TramsAPI Beta
Hi Doug

The load method is intended for scenarios where there is only one parameter, the record no.

Due to the complexity and size of UserProfile, we have several parameters that need to be specified for the various use cases.

I'll make a note and see what we can do.

BTW, we are considering implementing Active Directory integration so that users would have one password.  Is that something that you're interested in?  In that scenario, the CB username would have to match the AD username.

Thanks

Dan

Douglas Hammond

unread,
Apr 11, 2019, 2:07:19 PM4/11/19
to TramsAPI Beta
We don't use AD or ldap so this would not fit our use case but I'm sure it will be very welcomed.  Perhaps support for another SSO provider such as OAuth or some form of JWT token I think would be more beneficial then AD support as the ID provider could use any backend. 

Can I get " we have several parameters that need to be specified for the various use case"  or is this what you are taking note of and i should expect docs in the future?


Dan Palley

unread,
Apr 11, 2019, 3:22:07 PM4/11/19
to TramsAPI Beta
Doug,

You can see all of the parameters for UserProfile or any endpoint using UserProfile/GetParams.

There are 3 params that are specific to UserProfile:

  • LoginName
  • UserProfileNo
  • ExcludePerissions
In our internal usage of UserProfile, we use different combinations of these parameters depending on what we're doing (editing a single userprofile, or viewing all of them). 

You talked about syncing with your user directory.  Is that in a different application?

Dan

Douglas Hammond

unread,
Apr 11, 2019, 4:41:39 PM4/11/19
to TramsAPI Beta
Same purpose. Syncing our user database with CB

Maybe I am misunderstanding.

So to do a userprofile/load I need to POST with all params like  

{ "loginName": "SYSDBA", "noPermissions": true }

It hangs as it is loading all profiles.

I have tried the below too

{
"params: {
"loginName": "SYSDBA", "noPermissions": true
} }


and

{ "recNo": 1 }

and

{
"params: {
  "recNo": 1
}
}

How about an working example userprofile/load request so I can reproduce it?


Dan Palley

unread,
Apr 11, 2019, 5:57:18 PM4/11/19
to TramsAPI Beta

Hi Doug,

Here's a complete example:

{
  "SessionID" : "<session id>",
  "params" : {
    "loginName" : "SYSDBA",
    "noPermissions" : "true",
    "noMetadata" : "true"
  }
}

Response:

{
    "apiVersion": "4.08",
    "result": {
        "resultcode": 0,
        "resulttext": "",
        "dataset": {
            "name": "UserProfile",
            "data": {
                "userProfile": [
                    {
                        "userProfileNo": 1,
                        "loginName": "SYSDBA",
                        "loginpassword": null,
                        "userName": "SYSDBA",
                        "authorization": 2,
                        "lockedDate": null,
                        "pswdLastMod": "2017-02-13T12:18:12.723Z",
                        "TBOEnabled": 1,
                        "CBPEnabled": "X",
                        "CBPDefAgentProfile_LinkNo": null,
                        "CBPDefProfQuery": null,
                        "CBPDefActQuery": null,
                        "CBPDefResCardQuery": null,
                        "CBPDefInvenQuery": null,
                        "CBPDefIndProfTab": 0,
                        "CBPDefComProfTab": 0,
                        "CBPDefVenProfTab": 0,
                        "CBPDefProvProfTab": 0,
                        "CBPDefVenProvProfTab": 0,
                        "CBPDefAgtProfTab": 0,
                        "CBPDefOthProfTab": 0,
                        "CBPDefManager": 1,
                        "CBPGroupSecurity_LinkNo": null,
                        "countryCode": "",
                        "areaCode": "",
                        "defPhoneDesc": "111-1111",
                        "defFaxDesc": "222-2222",
                        "defEmailDesc": "te...@test.com",
                        "defWebDesc": "www.test.com",
                        "defSocialMediaDesc": null,
                        "title": "",
                        "agentEmail": "",
                        "userProfEmail": "dan.p...@sabre.com",
                        "SMTPHostAddr": "",
                        "SMTPPort": "",
                        "SMTPLoginType": "N",
                        "SMTPAccountLogin": null,
                        "SMTPAccountPassword": null,
                        "defSMTPMode": 0,
                        "SMTPSecConn": 0,
                        "defEmailClient": "M",
                        "handOffSetting": null,
                        "CBPRemToEmailCal": null,
                        "defaultEmailSignature": null,
                        "privLabWebUserName": "",
                        "privLabWebPassword": "",
                        "currentPasswordHash": "02A2FC57A8ADA06B5C2A274C50AE4984501351194DB4BD0843C314BB3350AF9E10E9F861D876D7FA9B67310B78FDEA7DF08C0D7241E204CA703F6F03674BF7AA35FF1ABE417B09681C333D15274C7C2CC18502F66303E483C8CFE6E0983A61A2263FD0C5DC4A29375FFBD214887A9DE6828B04E4DA76C8412B09CE327F50918D",
                        "PCC": null,
                        "hostAgentId": null,
                        "enableSingleSignOn": 0,
                        "CBOEnabled": "Y"
                    }
                ]
            }
        }
    }
}

Dan

Douglas Hammond

unread,
Apr 11, 2019, 7:23:06 PM4/11/19
to TramsAPI Beta
Ok so it is my confusion.  I'm tryiing load while you are do a query.  I'll keep using query instead of loads.

Dan Palley

unread,
Apr 11, 2019, 8:22:53 PM4/11/19
to TramsAPI Beta
Hi Doug,

Load is meant to work with endpoints that return single records that are updateable (invoices, payments, profiles, rescards, activities).  These methods typically only take one parameter: recNo.

Load an invoice, make changes, apply updates, etc.

Dan

Douglas Hammond

unread,
Apr 11, 2019, 9:25:28 PM4/11/19
to TramsAPI Beta
Loading a single userprofile is what I am trying to do.  Instead of using a `query` I am trying to `load` a userprofile so i can then update it with changes.

You had mentioned "You can use the parameterized load instead.".  Maybe it is just the wording and I'm think this means 'load' and you are referring to a 'query'

Also on a side note I do see 'recNo' referred to here and there on different types in the group and in the docs for getParams.  Is 'recNo' just an alias for the primary key, for example  profileNo and invoiceNo or something else all together as I do not see `recNo` in any of the results?  Maybe that is by my userprofile/load/xxx is not working as I'm assuming xxx is the recNo and that recNo is thee userProfileNo.


Dan Palley

unread,
Apr 12, 2019, 12:31:11 PM4/12/19
to TramsAPI Beta
Hi Doug,

recNo is the generic parameter for the load method.  It translates to the primary key.

UserProfile does not support the load method.  Please use runquery.

Dan

Michael Gumtow

unread,
Oct 11, 2019, 12:00:32 PM10/11/19
to TramsAPI Beta
Hi Dan, 

In regards to this statement: "The format of the delta dataset is somewhat complicated and a bit hard to explain in a post.  We'll be updating the documentation with more details; there are some samples of updates here in the forum"

Where can I get more details on how to properly send through an update through the API?

Thanks!

Dan Palley

unread,
Oct 11, 2019, 12:47:54 PM10/11/19
to TramsAPI Beta
Hi Mike,

For now, we'll have to work via examples in the forum.  I'm also working on some code samples that should hide most of the details of creating the update JSON.  

What type of development environment are you currently using?  Java, C#, VB?

Dan

Michael Gumtow

unread,
Oct 11, 2019, 2:43:15 PM10/11/19
to TramsAPI Beta
Hi Dan,

I'm using PHP to access the API methods.  Based on our previous conversation in a different thread, I'm now able to successfully create a new profile, but I'm also looking for some example update payloads for rescards and profiles.  I've searched through the forum to attempt to identify some other sample update examples, but I've noticed some conflicting information.  I'm guessing some of the information posted here is also a bit dated due to API upgrades as well.  Any further insight would be greatly appreciated.

Thanks!

Douglas Hammond

unread,
Oct 11, 2019, 2:46:33 PM10/11/19
to TramsAPI Beta
You can check out https://gist.github.com/wizhippo/f6fab0bac08683ffb6efa34e88977907

'userProfileUpdate' takes an user profile calculates the diff and submits.  Should give you an idea.

Dan Palley

unread,
Oct 11, 2019, 2:49:37 PM10/11/19
to TramsAPI Beta
Hi Mike,

Yes, some of the posts in the group are very outdated.  I hesitate to remove the posts since it's good information, but be careful about using examples that are more than a year old.

The format for doing updates is generally comparable to what you do for inserts, except you have to provide old/new values for tables that are being updated.  

Here's a link to an example of doing an update:


Feel free to describe what update you're trying to do and I'll be happy to help.

Dan

Dan Palley

unread,
Oct 11, 2019, 2:50:59 PM10/11/19
to TramsAPI Beta
Doug,

Thanks for posting that.  Looks great.

Dan

Douglas Hammond

unread,
Oct 11, 2019, 3:00:46 PM10/11/19
to TramsAPI Beta

Michael Gumtow

unread,
Oct 11, 2019, 4:53:45 PM10/11/19
to TramsAPI Beta
Thanks for passing on the example. 

I have created an update payload, but I just keep getting the following error: "{"apiVersion":"4.08","result":{"resultcode":99,"resulttext":" Error: Json Array expected, {\"update\":[{\"pr"}}"

I'm posting the sample payload provided below to the "profile/applyupdates" endpoint.

Do I need to also include the address and passenger components for profile updates for the payload to be valid?

Sample Payload:
{
   "SessionID":"{97FED5AD-096C-486C-A234-0B0489F0BD5D}",
   "deltaDataset":{
      "profile":{
         "update":{
            "profileNo":{
               "oldValue":267087
            },
            "profileType_LinkCode":{
               "oldValue":"I"
            },
            "name":{
               "oldValue":"Guy\/Test",
               "newValue":"Guy\/Test UPDATED"
            },
            "interfaceID":{
               "oldValue":null
            },
            "title":{
               "oldValue":null
            },
            "businessType":{
               "oldValue":null
            },
            "firstName":{
               "oldValue":"Test"
            },
            "lastName":{
               "oldValue":"Guy"
            },
            "middleInit":{
               "oldValue":null
            },
            "courtesyTitle":{
               "oldValue":null
            },
            "modifyBy":{
               "oldValue":"SYSDBA"
            },
            "modifyDateTime":{
               "oldValue":"2019-10-10T13:04:42.265Z"
            },
            "creationDate":{
               "oldValue":"2019-10-10T13:04:42.265Z"
            },
            "airlineNo":{
               "oldValue":null
            },
            "GL_LinkNo":{
               "oldValue":null
            },
            "preferredVendor":{
               "oldValue":"N"
            },
            "notes":{
               "oldValue":null
            },
            "additionalNotes":{
               "oldValue":null
            },
            "other":{
               "oldValue":null
            },
            "stmtRemarks":{
               "oldValue":null
            },
            "isActive":{
               "oldValue":"Y"
            },
            "payeeName":{
               "oldValue":null
            },
            "rate1":{
               "oldValue":null
            },
            "outsideRate":{
               "oldValue":null
            },
            "unappliedBalance":{
               "oldValue":0
            },
            "travelPref":{
               "oldValue":null
            },
            "salutation":{
               "oldValue":null
            },
            "primaryAgent_LinkNo":{
               "oldValue":null
            },
            "CB_Notes":{
               "oldValue":"Some Test Notes"
            },
            "vendorId":{
               "oldValue":null
            },
            "referredBy":{
               "oldValue":null
            },
            "serviceProviderOnly":{
               "oldValue":null
            },
            "branch_LinkNo":{
               "oldValue":null
            },
            "agencyRemarks":{
               "oldValue":"Some Test Agency Remarks"
            },
            "createBy":{
               "oldValue":"SYSDBA"
            },
            "webId":{
               "oldValue":null
            },
            "webPassword":{
               "oldValue":null
            },
            "misc1":{
               "oldValue":null
            },
            "misc2":{
               "oldValue":null
            },
            "GL2_LinkNo":{
               "oldValue":null
            },
            "GL2Rate":{
               "oldValue":null
            },
            "creditLimit":{
               "oldValue":null
            },
            "GLBranch_LinkNo":{
               "oldValue":null
            },
            "checkRemarks":{
               "oldValue":null
            },
            "altInterfaceID":{
               "oldValue":null
            },
            "bankAccountNo":{
               "oldValue":null
            },
            "bankRoutingNo":{
               "oldValue":null
            },
            "CBNotesBlobType_LinkNo":{
               "oldValue":2
            },
            "CBPLookupItem_LinkNo":{
               "oldValue":null
            },
            "additionalName":{
               "oldValue":null
            },
            "profileID":{
               "oldValue":null
            },
            "miscEcoValue":{
               "oldValue":null
            },
            "privLabel_LinkNo1":{
               "oldValue":null
            },
            "seg_LinkNo1":{
               "oldValue":null
            },
            "privLabel_LinkNo2":{
               "oldValue":null
            },
            "seg_LinkNo2":{
               "oldValue":null
            },
            "PCC":{
               "oldValue":null
            },
            "SPUniqueID":{
               "oldValue":null
            },
            "syncModDateTime":{
               "oldValue":"2019-10-10T13:04:42.000Z"
            }
         }
      }
   }
}

Dan Palley

unread,
Oct 11, 2019, 8:09:59 PM10/11/19
to TramsAPI Beta
Hi Mike,

So it looks like you're trying to change the name of an existing profile. 

Your sample looks good, but you need to specify the entries in an array, so add the opening bracket after "profile" like this:

{
    "deltaDataset": {
        "profile": [
            {
                "update": {
                    "profileNo": {

And at the end like this:

                    },
                    "syncModDateTime": {
                        "oldValue""2019-10-11T16:54:37.000Z"
                    }
                }
            }
        ]
    }
}

Dan

Dan Palley

unread,
Oct 11, 2019, 8:49:34 PM10/11/19
to TramsAPI Beta
Mike,

We're working on creating a simpler format for doing updates where only the fields that are changed or are needed to identify the updated record (primary key fields) are included.  Here's an example of your request using the new format:

{
    "deltaDataset": {
        "profile": [
            {
                "update": {
                    "profileNo": {
                        "oldValue"8616
                    },
                    "name": {
                        "oldValue""Guy/Test",
                        "newValue""Guy/Test Updated"
                    },
                    "firstName": {
                        "oldValue""Test",
                        "newValue""Test Updated"
                    },
                }
            }
        ]
    }
}

Dan

Douglas Hammond

unread,
Oct 11, 2019, 8:53:26 PM10/11/19
to TramsAPI Beta
Just curious why the old values are even needed.  Are you using them in the background to make sure they have not been changed since last read?  Versioning would be a good fit here.
Reply all
Reply to author
Forward
0 new messages