Bold360 ai widget protocol API
The Bold360 ai API is an XML over HTTP protocol, which communicates with the Bold360 ai services. All requests are sent tohttp://www.google.com/url?q=http%3A%2F%2Fmy.Nanorep.com%2FKB&sa=D&sntz=1&usg=AFQjCNHb3dmBzGfcPFHqgmuaTNUdlP_bbw http://my.Nanorep.com/KB with a POST HTTP request method.
For each request, you need a session ID that you obtain with a Login request. When you have a session ID, you can use the API to search, open tickets, request Analytics and statistics information, and more.
This article walks you through how to send and receive the various types of API requests. For more information, visit the Bold360 ai Support Center on our website.
Logging in - Creating a Session
The Login request provides you with a new unique session ID, which is required for sending queries to the system. Any attempt to use an invalid session ID results in a 400 BAD REQUEST response from the server, which is common with session expiration occurring after an idle timeout. Therefore, you should be prepared to handle these errors and send a new Login request before you send additional queries:
<Nanorep> <Login anonymous='true'> <WidgetAPI version="1.22" account="account" enableStats="enableStats"> <pageUrl><![CDATA[referringPage]]></pageUrl> </WidgetAPI> </Login> </Nanorep>
- Bold360 ai Account name.
- Accepts 'true' or 'false', enables analytics tracking for this session.
- The URL of the page from which the API is used.
After sending a Login request, the service will reply with a Login response, which contains information about the generated session (if succeeded), or error information (if failed):
<Nanorep> <LoginResponse sessionId='sessionId' initCode='0' lang='en' timeout='sessionIdleTimeout'> message </LoginResponse> </Nanorep>
- When non-zero, login is successful. Otherwise, the message contains information regarding the failure.
- Specifies the maximum time in seconds a session can be idle before it expires on the service. When a session expires you are required to send a new login request to obtain a new session ID.
If you receive error code 400 for the login request, then your login request was illegal. In this case, check your account name, and referring page configuration.
After successful login, you may use the provided sessionId to send queries to the service.
Query Request Structure
All Bold360 ai API requests share a common structure, containing an XML envelope, and a <Session> tag with common parameters:
<?xml version='1.0' encoding='UTF-8' ?> <Nanorep> <Session id='sessionId' userUniqueId='0' requestId=''requestId'/> ... </Nanorep>
- The session ID you received in the login response.
A unique ID (for this session only) used by the service, normally this ID starts with a fixed number (i.e 1, although it can start at any number) and is incremented for each subsequent request.
Request ID should never be repeated, and is used by the service to uniquely identify requests, in cases of network errors and re-transmissions.
Beside the <Session> tag, the XML envelope contains additional query syntax. For example, a valid search query request will look as follows:
POST /KB HTTP/1.1 Host: my.Nanorep.com Connection: keep-alive