Using the API you can add existing datasets to a Project.
You need to be the Admin of the Datasets that you want to add, and the Project itself.
The unique identifier dataset_hash for every dataset is needed for this functionality.
var axios =require('axios');var data =JSON.stringify({"query_type":"projectdataset","query_method":"POST","values":{"uid":null,"payload":{"dataset_hashes":'["aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeee1", "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeee2"]'}}});var config ={method:'post',url:'https://api.encord.com/public',headers:{'Content-Type':'application/json','ResourceID':'<project_id>','Authorization':'<private_key>','Accept':'application/json'},data: data};axios(config).then(function(response){console.log(JSON.stringify(response.data));}).catch(function(error){console.log(error);});
You can remove existing Datasets to a Project using the API.
The unique identifier dataset_hash is required for every dataset to be removed
Only the Admin of a project is eligible to execute this functionality.
var axios =require('axios');var data =JSON.stringify({"query_type":"projectdataset","query_method":"DELETE","values":{"uid":'<List of dataset hashes to delete>',}});var config ={method:'post',url:'https://api.encord.com/public',headers:{'Content-Type':'application/json','ResourceID':'<project_id>','Authorization':'<private_key>','Accept':'application/json'},data: data};axios(config).then(function(response){console.log(JSON.stringify(response.data));}).catch(function(error){console.log(error);});
The email_id of the users need to be provided as an input.
Project user roles are
Admin = 0,
Annotator = 1,
Reviewer = 2,
Annotator & Reviewer = 3,
Team manager = 4
var axios =require('axios');var data =JSON.stringify({"query_type":"projectusers","query_method":"POST","values":{"uid":'<private_key>',"payload":{"user_emails":'<List of user emails>',"user_role":'<User role of the new users>'}}});var config ={method:'post',url:'https://api.encord.com/public',headers:{'Content-Type':'application/json','ResourceID':'<project_id>','Authorization':'<private_key>','Accept':'application/json'},data: data};axios(config).then(function(response){console.log(JSON.stringify(response.data));}).catch(function(error){console.log(error);});
Fetch information associated with a given Project.
var axios =require('axios');var data =JSON.stringify({"query_type":"project","query_method":"GET","values":{"uid":null,"payload":null}});var config ={method:'post',url:'https://api.encord.com/public',headers:{'Content-Type':'application/json','ResourceID':'<project_id>','Authorization':'<private_key>','Accept':'application/json'},data: data};axios(config).then(function(response){console.log(JSON.stringify(response.data));}).catch(function(error){console.log(error);});
You can fetch the Ontology of an existing project using the above API call. The editor Ontology can be found in the API response under the key editor_ontology.