Table of Contents. 1 Introduction Connecting to the API HTTP request syntax API release versions... 4

Similar documents
USO RESTRITO. SNMP Agent. Functional Description and Specifications Version: 1.1 March 20, 2015

Secure File Transfer Protocol (SFTP) Interface for Data Intake User Guide

OASIS SUBMISSIONS FOR FLORIDA: SYSTEM FUNCTIONS

Stock Affiliate API workflow

Using UB Stream and UBlearns

Date: October User guide. Integration through ONVIF driver. Partner Self-test. Prepared By: Devices & Integrations Team, Milestone Systems

PAGE NAMING STRATEGIES

Requesting Service and Supplies

Faculty Textbook Adoption Instructions

Exosoft Backup Manager

SmartPass User Guide Page 1 of 50

Information on using ChurchApp

Adverse Action Letters

PRIVACY AND E-COMMERCE POLICY STATEMENT

Introduction to Mindjet on-premise

ClassFlow Administrator User Guide

Connect+/SendPro P Series Networking Technical Specification

TaskCentre v4.5 Save As File Tool White Paper

Aras Innovator 11. Client Settings for Chrome on Windows

CROWNPEAK DESKTOP CONNECTION (CDC) INSTALLATION GUIDE VERSION 2.0

User Guide. Table Of Contents. Logging In. Job Search. Job Information. Site Search & Logging A Job. Customer Search. Job Dashboard.

TRAINING GUIDE. Overview of Lucity Spatial

Release Notes Version: - v18.13 For ClickSoftware StreetSmart September 22, 2018

MyUni Adding Content. Date: 29 May 2014 TRIM Reference: D2013/ Version: 1

These tasks can now be performed by a special program called FTP clients.

1 Introduction Functions... 2

PAY EQUITY HEARINGS TRIBUNAL. Filing Guide. A Guide to Preparing and Filing Forms and Submissions with the Pay Equity Hearings Tribunal

SmartLink for Albridge Web Services

How to use DCI Contract Alerts

HP MPS Service. HP MPS Printer Identification Stickers

Wave IP 4.5. CRMLink Desktop User Guide

OO Shell for Authoring (OOSHA) User Guide

VISITSCOTLAND - TOURS MANAGEMENT SYSTEM Manual for Tour Operators

HPE LoadRunner Best Practices Series. LoadRunner Upgrade Best Practices

Once the Address Verification process is activated, the process can be accessed by employees in one of two ways:

Dispatch Application Programming Interface

Callback Guide. A step by step guide to integrating Callback with your website. All the information you need to confirm Nochex payments.

User Guide. Avigilon Control Center Mobile Version 2.2 for Android

Using the Swiftpage Connect List Manager

Type: System Enhancements ID Number: SE 93. Subject: Changes to Employee Address Screens. Date: June 29, 2012

Amyuni Document Converter

Your New Service Request Process: Technical Support Reference Guide for Cisco Customer Journey Platform

TaskCentre v4.5 XML to Recordset Tool White Paper

Advanced and Customized Net Conference Powered by Cisco WebEx Technology

Dynamic Storage (ECS)

Password Management Guidelines

RSA SecurID (Token): Passcode & PIN Initialization / Setup Guide

Announcing Veco AuditMate from Eurolink Technology Ltd

Milestone XProtect. NVR Installer s Guide

MANAGING FORWARDING ACCOUNTS

Creating an Online Account

NowPrint Release Notes. Last Updated: 2/1/2012

Configuring Database & SQL Query Monitoring With Sentry-go Quick & Plus! monitors

Online Image Viewing Agent User Guide. Texas FAIR Plan Association 1

Using the Swiftpage Connect List Manager

Proper Document Usage and Document Distribution. TIP! How to Use the Guide. Managing the News Page

DICOM Correction Proposal

RISKMAN REFERENCE GUIDE TO USER MANAGEMENT (Non-Network Logins)

INSTALLING CCRQINVOICE

To start your custom application development, perform the steps below.

AvePoint Pipeline Pro 2.0 for Microsoft Dynamics CRM

Procurement Contract Portal. User Guide

Skype Meetings

In Outlook, how do I allow other users to view my Calendar or other folders in my Exchange mailbox?

Aras Innovator 11. Client Settings for Chrome on Windows

Frequently Asked Questions Read and follow all instructions for success!

Aras Innovator Viewer Add-Ons

ROCK-POND REPORTING 2.1

Refreshing Axiom TEST with a Current Copy of Production Axiom EPM June 20, 2014

Case Metrics Guide. January 11, 2019 Version For the most recent version of this document, visit our documentation website.

Relius Documents ASP Checklist Entry

TIBCO Statistica Options Configuration

Ephorus Integration Kit

TechSmith Relay 5.1.5

ONTARIO LABOUR RELATIONS BOARD. Filing Guide. A Guide to Preparing and Filing Forms and Submissions with the Ontario Labour Relations Board

September 24, Release Notes

Jira For T2S. External User Guide. Version 1.1

Getting Started with the Web Designer Suite

Design Patterns. Collectional Patterns. Session objectives 11/06/2012. Introduction. Composite pattern. Iterator pattern

Receiving, Completing and Submitting an HP Materials Declaration Using the Material Declaration Form (MDF 2.0)

Lab 4. Name: Checked: Objectives:

Access the site directly by navigating to in your web browser.

I - EDocman Installation EDocman component EDocman Categories module EDocman Documents Module...2

Reporting Requirements Specification

Integrating QuickBooks with TimePro

Please contact technical support if you have questions about the directory that your organization uses for user management.

RxAXIS Security Module 09/25/2013

161 Forbes Road Braintree MA Phone: (781) Fax: (781) What's in it? Key Survey & Extreme Form

Network Rail ARMS - Asbestos Risk Management System. Training Guide for use of the Import Survey Template

Single File Upload Guide

Table of Contents. WipeDrive Enterprise Logging, March Logging Settings... 3 Log Format Types Audit Log Destination Options...

Background Check Procedures for Sponsors

Xilinx Answer Xilinx PCI Express DMA Drivers and Software Guide

MARYLAND PHYSICIANS CARE (00247) ERA ENROLLMENT INSTRUCTIONS

HP ExpertOne. HP2-T21: Administering HP Server Solutions. Table of Contents

Your Project Plan and Smartsheet

SUPPLIER CONNECTION SUPPLIER REFERENCE GUIDE FOR LEAR SUPPLIERS

Enterprise Chat and Developer s Guide to Web Service APIs for Chat, Release 11.6(1)

ClubRunner. Volunteers Module Guide

ComplyWorks Subscription User Guide. October 6, 2011

Transcription:

API Guide

Table f Cntents 1 Intrductin... 3 2 Cnnecting t the API... 4 2.1 HTTP request syntax... 4 2.2 API release versins... 4 3 Direct Answer API... 5 3.1 Required parameters... 5 3.2 Optinal parameters... 5 3.3 Perfrmance... 6 3.4 Direct Answer API hell wrld... 6 3.4.1 HTTP request... 6 3.4.2 XML respnse... 7 3.4.3 The XML explained... 7 4 Query API... 9 4.1 Required parameters... 9 4.2 Optinal parameters... 9 4.3 Query API hell wrld... 9 4.3.1 HTTP request... 9 4.3.2 XML respnse... 10 4.3.3 The XML explained... 10 5 Crediting True Knwledge... 12

1 Intrductin The True Knwledge API enables develpers t utilize True Knwledge s functinality in third party applicatins. True Knwledge prvides the fllwing API services: the Direct Answer API and the Query API. The Direct Answer API expses the natural language questin answering feature f True Knwledge while the Query API allws users t bypass ur natural language translatin system and directly query the knwledge base using a simple query language. API services are cmprised f HTTP requests and XML respnses. 3

2 Cnnecting t the API This chapter details the syntax f the HTTP requests that are used t cmmunicate with the True Knwledge API. 2.1 HTTP request syntax The True Knwledge API is queried using HTTP GET requests. The syntax f these requests is: https://<hst>/<service_name>?<parameters> <hst> The IP address (r name) f the machine that hsts the service. <service name> This is the name f the service. Fr example direct_answer r query. <parameters> One r mre f the HTTP request parameters. Nte that individual parameters must be URL-encded and separated with ampersands. Fr example: http://api.trueknwledge.cm/direct_answer/?questin=list+f+james+b nd+actrs&api_accunt_id=[api_username]&api_passwrd=[passwrd] 2.2 API release versins In the future we may release new versins f ur API; we will always strive t make new versins backwards cmpatible with previus releases but in rder t prvide the ptin t ur API users there is the fllwing methd f specifying which API versin yu want t use. If yu wuld like t use the mst recent stable versin then this is the syntax t use: https://api.trueknwledge.cm/<service_name>/stable?<parameters> If n versin is specified then stable is the default ptin, s the abve URL is the same as: https://api.trueknwledge.cm/<service_name>?<paramaters> If yu want t use the latest (but nt necessarily stable) versin f the API this is the syntax t use: https://api.trueknwledge.cm/<service_name>/latest?<parameters> If yu want t use a specific versin f the API this is the syntax t use: https://api.trueknwledge.cm/<service>/<versin_number>?<parameters > 4

3 Direct Answer API The Direct Answer API enables develpers t utilize True Knwledge s natural language questin answering technlgy in their wn applicatins. 3.1 Required parameters api_accunt_id=[api_username] passwrd=[passwrd] questin=[url encded questin string] This is where yu specify yur questin. Which shuld be URL encded, e.g. What%27s+the+time+in+Chicag%3F is what yu wuld set fr the questin What s the time in Chicag? 3.2 Optinal parameters timeut_ms=<millisecnds> If a respnse hasn t been returned within the number f millisecnds specified then the request will be halted and a timeut message returned. structured_respnse=[1 0] (1 by default) If this is set t 0 nly the text_result and status fields will be returned regardless f what parameters are set. questin_entities=[1 0] (1 by default) If we can identify an entity f interest in the questin then we ll return that in additin t the answer. E.g. the questin Wh wrte the Da Vinci Cde? will return [the da vinci cde] as well as the answer [dan brwn]. retranslate=[1 0] (0 by default) This will utput True Knwledge s interpretatin f what was asked and return it within the <tk:retranslatin> tag. bject_metadata=wikipedia,fficial,image64,image128,image1 50,imageprfile (wikipedia, fficial and image150 set by default) This parameter gives the ptin f including useful metadata with yur answer. wikipedia This will include the URL f the wikipedia page related t each result (if we knw f ne). fficial This will include the URL f the fficial website f each result (if we knw f ne), e.g. if the questin is Wh wrte the Da Vinci Cde? then the respnse will include the URL: http://www.danbrwn.cm/ assciated with the [dan brwn] entity. 5

image64 Returns a thumbnail image assciated with each result (if we have ne) that is cnstrained t a bunding bx f 64x64 pixels. image128 Returns a thumbnail image assciated with each result (if we have ne) that is cnstrained t a bunding bx f 128x128 pixels. image150 Returns a thumbnail image assciated with each result (if we have ne) that is cnstrained t a bunding bx f 150x150 pixels. imageprfile Returns an image assciated with each result (if we have ne) that is cnstrained t a bunding bx f 225 pixels wide x 600 pixels high. 3.3 Perfrmance Fr maximum perfrmance set structured_respnse t 0, this will nly return the <tk:status> and <tk:text_result> fields. If yu want yur answer s entities but nt yur questin s entities then set questin_entities t 0. The fewer parameters yu set the quicker yu will receive yur respnse. Fr example, setting bject_metadata t return the URL f every image size available will take slightly lnger than just returning ne image URL. 3.4 Direct Answer API hell wrld The Direct Answer API hell wrld is sending a request fr the time in Chicag and getting Chicag s current lcal time back alng with a link t the Wikipedia page fr Chicag and a thumbnail pht f the Chicag skyline. 3.4.1 HTTP request https://api.trueknwledge.cm/direct_answer? questin=what's+the+time+in+chicag &bject_metadata=image128,wikipedia &api_accunt_id=[username] &api_passwrd=[passwrd] 6

3.4.2 XML respnse <?xml versin="1.0" encding="utf-8"?> <tk:respnse xmlns:tk=http://www.trueknwledge.cm/ns/kengine xmlns="http://www.w3.rg/1999/xhtml" understd="true" answered="true" type="direct_answer"> <tk:status>cmpleteness unknwn</tk:status> <tk:text_result>march 16th 2009, 10:57:30 CDT</tk:text_result> <tk:structured_result> <tk:result> <tk:bject> <tk:id>[lcal timepint: [timepint: ["2009/3/16/10/57/30"]]; [central daylight time]]</tk:id> </tk:bject> </tk:result> <tk:questin_entities> <tk:bject> <tk:id>[chicag]</tk:id> <tk:metadata parameter="image128">http://www.truekn wledge.cm/images/thumbs/128/128/2004-07- 14_2600x1500_chicag_lake_skyline.jpg< /tk:metadata> <tk:metadata parameter="wikipedia">http://en.wikipe dia.rg/wiki/chicag</tk:metadata> </tk:bject> </tk:questin_entities> </tk:structured_result> <tk:tk_questin_url>http://www.trueknwledge.cm/q/what 's_the_time_in_chicag</tk:tk_questin_url> </tk:respnse> 3.4.3 The XML explained XML field <tk:respnse xmlns:tk="http://www.trueknwledge.cm/ns/kengine" xmlns="http://www.w3.rg/1999/xhtm l" understd="true" Descriptin This is the cntainer field fr the entire direct answer API respnse. There are tw attributes f interest in this XML tag and they are the understd and answered attributes. understd means we have understd the questin 7

answered="true" type="direct_answer"> <tk:status> <tk:text_result> <tk:structured_result> <tk:result> <tk:questin_entities> <tk:bject> <tk:id> <tk:metadata parameter="image128"> <tk:metadata parameter="wikipedia"> <tk:tk_questin_url> and answered means we have answered the questin. This returns either yes, n, cmplete r cmpleteness unknwn. Fr yes/n questins the respnse is self explanatry. If the questin is nt yes/n the status field will return cmplete if we knw that we have the cmplete answer (e.g. Wh is a child f President Mnre is status cmplete because we knw that we knw abut all f President Mnre s children), in mst cases hwever the respnse will be cmpleteness unknwn as the majrity f the time we dn t knw if we have a cmplete answer. This field cntains the main text answer t the questin. This is the cntainer field fr the structured results (images, links, etc). This field cntains the structured versin f the answer. This is the cntainer field fr questin entities (entities that appeared in the questin). This is a cntainer field fr each questin entity. This field cntains the True Knwledge ID f a questin entity. This field cntains the URL f a thumbnail image f a questin entity (in this case the thumbnail will have been scaled t fit in a 128x128 pixel bunding bx). This field cntains a questin entity s Wikipedia page URL. This is the permanent URL t the questin and answer page n trueknwledge.cm 8

4 Query API The Query API allws autmated systems t bypass ur natural language translatin system and directly query the knwledge base using a simple query language. Fr mre infrmatin n writing True Knwledge queries visit: http://www.trueknwledge.cm/dcs/query_language/ 4.1 Required parameters api_accunt_id=[api_username] passwrd=[passwrd] query_text=[url encded true knwledge query] e.g. query+result%0a%5b%22+44+1223+323382%22%5d+%5bcan+den te%5d+number%0aresult+%5bis+the+gegraphical+area+f r+the+telephne+number%5d+number 4.2 Optinal parameters mde=[establish full] (establish by default) establish respnds with either yes r n/unknwn fr truth queries ( yes/n questins), whereas full respnds with either yes, n, r unknwn. Fr mst queries establish will be sufficient. translate_answers=[1 0] (0 by default) This will return the answer in a frm that is easy fr peple t read as well as the machine readable frmat. 4.3 Query API hell wrld The QUERY API hell wrld is sending a request fr the gegraphical lcatin that matches the telephne number +44.1223.323382 and getting the respnse [the cambridge telephne cde area]. 4.3.1 HTTP request https://api.trueknwledge.cm/query? query=query+bj%0a%5b%22+44+1223+323382%22%5d+%5bcan+dente%5 D+number%0Abj+%5Bis+the+gegraphical+area+fr+the+telephne+ number%5d+number &api_accunt_id=[username] &api_passwrd=[passwrd] 9

4.3.2 XML respnse <?xml versin="1.0" encding="utf-8"?> <tk:respnse xmlns:tk="http://www.trueknwledge.cm/ns/kengine" xmlns="http://www.w3.rg/1999/xhtml" type="query"> <tk:status>cmpleteness unknwn</tk:status> <tk:num_results>3</tk:num_results> <tk:result> <tk:variable name="bj"> <tk:id>[the cambridge telephne cde area]</tk:id> </tk:variable> </tk:result> <tk:result> <tk:variable name="bj"> <tk:id>[cambridgeshire]</tk:id> </tk:variable> </tk:result> <tk:result> <tk:variable name="bj"> <tk:id>[the united kingdm and the channel islands]</tk:id> </tk:variable> </tk:result> </tk:respnse> 4.3.3 The XML explained XML field <tk:respnse xmlns:tk="http://www.trueknwledge.cm/ns/kengine" xmlns="http://www.w3.rg/1999/xhtm l" type="query"> <tk:status> Descriptin tk:respnse is the cntainer field fr the entire query api respnse. This returns either yes, n, cmplete r cmpleteness unknwn. Fr yes/n questins the respnse is self explanatry. If the questin is nt yes/n the status field will return cmplete if we knw that we have the cmplete answer (e.g. query x x [is a child f] [president james mnre] is status cmplete because we knw that we knw abut all f President Mnre s children), in mst cases hwever the respnse will be 10

<tk:num_results> <tk:result> <tk:variable name="bj"> <tk:id> cmpleteness unknwn as the majrity f the time we dn t knw if we have a cmplete answer. The number f results in the respnse. The cntainer field fr each result. This is the variable name that was queried fr and cntains the result fr that variable. The True Knwledge ID f the entity. 11

5 Crediting True Knwledge With a free API accunt, users f ur API services must credit True Knwledge and place a prminent link back t ur site: http://www.trueknwledge.cm/. With the direct answer service the questin URL returned in the tk_questin_url tag shuld be used. If yu wish t avid this requirement, please cntact us at partners@trueknwledge.cm If yu want yu can use this image as yur credit link: This image can be fund here: http://www.trueknwledge.cm/dwnlads/pwered_by_tk.png Fr example yur credit may lk like this when using the direct answer service: <a href= http://www.trueknwledge.cm/q/what_is_the_capital_f_france title= What is the capital f France ><img src= http://www.trueknwledge.cm/dwnlads/pwered_by_tk.png alt= Pwered by True Knwledge ></a> 12

2009 True Knwledge Ltd. All rights reserved. This manual, as well as the sftware described in it, is prvided under license and may be used r cpied nly in accrdance with the terms f such licence. The cntent f this manual is prvided fr infrmatinal use nly, is subject t change withut ntice, and shuld nt be cnstrued as a cmmitment by True Knwledge Limited. True Knwledge Limited assumes n respnsibility r liability fr any errrs r inaccuracies that may appear in this manual. Except as permitted by such licence, n part f this publicatin may be reprduced, stred in a retrieval system, r transmitted, in any frm r by any means, electrnic, mechanical, recrding, r therwise, withut the prir written permissin f True Knwledge Limited. 13