Introduction & installation of the Graft REST API
The Graft REST API supports simple access to projects created via Graft's web UI. Using the API you can export entity data, perform similarity searches, get enrichment predictions, and invoke saved queries.
Prerequisites
- Install CURL
- Generate and save in a safe place an API Key
API SECURITY
Ensure that you do not put your secret key in a public repo or publish in any way
Common values
The following values are common to all REST API queries
- 'organization': the name assigned to your organization (used as part of the UI login)
- 'secret': your personal API key generated in item 2 above
- 'project': the ID of the project you wish to work on
- this can be found in the Browser URL, for example in the URL
- https://app.graft.com/projects/un7n8/apps/library/search/0/myxib/details/api - the project ID is uhgs1
- 'instance_name': the ID of the app you wish to work on - it is automatically generated by Graft
- this can be found in the Browser URL, for example in the URL https://app.graft.com/projects/un7n8/apps/library/search/0/myxib/details/api - the instance name is myxib
- 'config_name': is the configuration of the unique App you are looking to use. The default is "my_config" however it is possible for the user to edit this initial config and save multiple configurations and access these through the API
Output formats
The REST API supports csv, tsv and json_lines format for outputs.
Example values
For each of the API calls we provide a simple (possibly humorous) example based on the following values
- 'organization' = supervillain
- 'secret' = somethingiamnotgoingtosaveingithub
- 'project' = world_domination
- 'entity' = despicable_plan_1
- 'embedding_name' = my_embedding
- 'saved_query' = find_bananas
- 'entity_knn_id' = kevin_101
- 'output_format' = csv
- 'entity_knn_adhoc' = various nefarious skills including stealth