I’m getting this error message when trying to use the API docs and it appears it’s not working on my staging site either.
“errors”: " at Microsoft.VisualBasic.ErrObject.Raise(Int32 Number, Object Source, Object Description, Object HelpFile, Object HelpContext)\r\n at CGI4VB.Check_Session_Timestamp(eSESSIONID_USAGE_TYPE sessionid_usage, eSESSION_VALIDATION_OPTIONS sessionValidation) in D:\\mst-agile-git\\Source\\CGI4VB\\CGI4VB.vb:line 5396\r\n at CGI4VB.LoadIni(String SessionIdentifier, Boolean plainTextDBId, eSESSION_VALIDATION_OPTIONS sessionValidation, eSESSIONID_USAGE_TYPE sessionid_usage, String username, Boolean idIsBase32, Boolean allowloadreginternal) in D:\\mst-agile-git\\Source\\CGI4VB\\CGI4VB.vb:line 3699\r\n at DataHandlerExtension.DAL.DataHandlerHelper.AuthorizeRequest(String SessionId, String LanguageCode, eSESSIONID_USAGE_TYPE sessionUsage, Boolean nosession, Boolean novalidate, Boolean base32) in D:\\mst-agile-git\\Source\\WebServices\\REST\\DataHandlerExtension\\DAL\\DataHandlerHelper.cs:line 351\r\n at PcrRestApi.App_Start.CustomMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in D:\\mst-agile-git\\Source\\WebServices\\REST\\PcrRestApi\\App_Start\\RequestHandler.cs:line 177"
The SessionId I’m using is this:
I tried from my end and it’s showing that SessionId is not valid. It most likely timed out based on your database timeout settings. Can you try generating a new SessionId and re-running your request? In the future I would recommend not posting SessionId directly on the forum as someone else could just them to access your data if they were live.
Thanks I removed it. Interesting, I’ll try a different session id and see if it changes.
We have a couple apps that are using a static SessionId and they’re still working. Do we need to get a SessionId every time we make a call to the API?
No, but I would refresh it every now and again (24-48 hours?) I am almost positive it’s based on the timeout for the database.
Is this a recent change? We’ve used the same sessionId on one of our apps for like a year. Our database timeout is set to 1,000 hours so that wouldn’t have allowed us to use it that long…
ErrObject.Raise(Int32, Object, Object, Object, Object) Method
Generates a run-time error; can be used instead of the Error statement.
public void Raise (int Number, object Source = null, object Description = null, object HelpFile = null, object HelpContext = null);
Required. Long integer that identifies the nature of the error. Visual Basic errors are in the range 0-65535; the range 0-512 is reserved for system errors; the range 513-65535 is available for user-defined errors. When setting the Number property to your own error code in a class module, you add your error code number to the vbObjectError constant. For example, to generate the error number 513, assign vbObjectError + 513 to the Number property.
Optional. String expression naming the object or application that generated the error. When setting this property for an object, use the form project.class. If Source is not specified, the process ID of the current Visual Basic project is used.
Optional. String expression describing the error. If unspecified, the value in the Number property is examined. If it can be mapped to a Visual Basic run-time error code, the string that would be returned by the Error function is used as the Description property. If there is no Visual Basic error corresponding to the Number property, the “Application-defined or object-defined error” message is used.
Optional. The fully qualified path to the Help file in which help on this error can be found. If unspecified, Visual Basic uses the fully qualified drive, path, and file name of the Visual Basic Help file.
Optional. The context ID identifying a topic within HelpFile that provides help for the error. If omitted, the Visual Basic Help-file context ID for the error corresponding to the Number property is used, if it exists.