Databoard API docs


Get started using our API in <5 minutes.





Users




/api/user/edit

an endpoint to get user profile information.

['POST']

POST method


curl -d '{"first_name": "Slim", "last_name": "Jim", "bio": "a sad lonely piece of beef jerky.", "alias": "slimjim", "github_url": "", "status": "private"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}' {{session['base_url']}}/api/user/edit -k



successful response, 200


{
   message: "Successfully edited user profile"
}


error response, 400


{
   message: "Error: Invalid user_id or auth_token"
}




/api/user/read

an endpoint to get user profile information.

['POST']

POST method


curl -d '{}' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}' {{session['base_url']}}/api/user/read -k



successful response, 200


{
   datasets: {
      "580ba5d3-5934-4ca4-95c9-1e589af67b86": {
         data_type: null,
         dataset_id: "580ba5d3-5934-4ca4-95c9-1e589af67b86",
         dataset_size: 1210,
         description: "teststt",
         download_number: 0,
         license_type: "Databoard Standard license",
         limit: "10-100MB",
         name: "test survey",
         organization_source: null,
         sample_number: 1,
         star_number: 1,
         status: "private",
         user_source: "d581f347-5ce9-48a8-a998-337c21167e2a",
         view_number: 0
      }
   },
   profile: {
      created_dataset_number: 1,
      dataset_downloads: 0,
      datasets_limit: 2152852357120,
      datasets_size: 1210,
      datasets_stars: 0,
      datasets_views: 0,
      email: "jim.schwoebel@gmail.com",
      email_confirm: true,
      followers: 0,
      following: 1,
      is_active: true,
      is_authenticated: true,
      joined_org_number: 1,
      last_login: "2022-06-17 14:09:59.467493",
      login_expires: "2022-06-18 14:09:59.467493",
      login_number: 5,
      notification_number: 8,
      notifications_status: true,
      registration_date: "None",
      reset_date: "2022-06-16 13:57:48.108448",
      starred_dataset_number: 1,
      subscription_canceldate: null,
      subscription_date: "2022-06-17 14:10:25.644271",
      subscription_renewdate: "2022-07-17 14:10:25.644271",
      subscription_status: "active",
      subscription_type: "enterprise",
      user_id: "d581f347-5ce9-48a8-a998-337c21167e2a",
      user_public_url: "https://172.23.166.225:8000/user/public/d581f347-5ce9-48a8-a998-337c21167e2a",
      user_referral_url: "https://172.23.166.225:8000/user/refer/d581f347-5ce9-48a8-a998-337c21167e2a",
      user_type: "paid"
   }
}


error response, 400


{
   message: "Error: Invalid user_id or auth_token"
}



Organizations




/api/organization/create

an endpoint to create organizations.

['POST']

POST method


curl -d '{"org_name": "Databoard", "description": "a community of data engineers and architects.", "size": "30 employees", "status": "public", "license_type": "Databoard Standard License"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}' {{session['base_url']}}/api/organization/create -k



successful response, 201


{
   message: "Organization created sucessfully",
   organization: "Databoard",
   organization_auth_token: "1-RK-2pLSeOepbg5ahHW5Gi0YBDC5D6pYXHhYRC25mJA6zq12MNnmSoZP3QNjMHR7DeOWT9gQicOm0OdDCKykg",
   organization_id: "40c02da2-4dbe-49f8-a2a9-df00adb68734"
}


error response, 400


{
   message: "Error: organization exists"
}





/api/organization/delete

an endpoint to delete organizations.

['POST']

POST method


curl -d '{}' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/organization/delete -k



successful response, 201


{
   message: "Organization deleted sucessfully",
   organization: "Databoard"
}


error response, 400


{
   message_1: "Error: organization_id or auth_token invalid",
   message_2: "Error: organization user does not exist",
   message_3: "Error: Provided organization user is not an approved administrator"
}





/api/organization/edit

an endpoint to edit organization profile information.

['POST']

POST method


curl -d '{"organization_name": "new name", "organization_description": "description", "organization_status": "private", "organization_size": "30 employees", "organization_default_license": "Apache 2.0 license"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/organization/edit -k



successful response, 200


{
   message: "Organization has been updated"
}


error response, 400


{
   message: "Error: organization_id/organization_auth_token is invalid"
}





/api/organization/read

an endpoint to get organization profile information.

['POST']

POST method


curl -d '{}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/organization/read -k



successful response, 200


{
   datasets: {},
   organization_default_license: "Databoard Standard license",
   organization_description: "asdasfsdf",
   organization_logo_url: null,
   organization_name: "chessboard2",
   organization_size: "0-10 employees",
   organization_status: "private"
}


error response, 400


{
   message: "Error: Organization_id or auth_token invalid"
}





/api/organization/user/edit

an endpoint to edit user roles in organizations.

['POST']

POST method


curl -d '{"user_id": "{{session['user_id']}}", "new_role": "general"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/organization/user/edit -k



successful response, 201


{
   message: "User successfully changed role in organization",
   user_id: "3af319e1-def1-45a5-ab5e-2b99f8fdb94d"
}


error response, 400


{
   message_1: "Error: new_role is not one of the following ['admin','general','billing']",
   message_2: "Error: Organization_id does not exist, or organization auth token invalid",
   message_3: "Error: User_id does not have a role in organization, or improper user_id"
}





/api/organization/user/join

an endpoint to request to join an organization.

['POST']

POST method


curl -d '{"organization_id": "{{session['organization_id']}}"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}' {{session['base_url']}}/api/organization/user/join -k



successful response, 201


{
   message: "User requested to join organization sucessfully",
   user_id: "3af319e1-def1-45a5-ab5e-2b99f8fdb94d"
}


error response, 400


{
   message_1: "Error: User is alreaedy an organization user of role [roletype]",
   message_2: "Error: Organization_id does not exist",
   message_3: "Error: User_id or auth token is invalid"
}





/api/organization/user/remove

an endpoint to remove users from organizations.

['POST']

POST method


curl -d '{"user_id": "{{session['user_id']}}"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/organization/user/remove -k



successful response, 201


{
   message: "User successfully removed from organization",
   user_id: "3af319e1-def1-45a5-ab5e-2b99f8fdb94d"
}


error response, 400


{
   message_1: "Error: Organization_id does not exist, or organization auth token invalid",
   message_2: "Error: User_id does not have a role in organization, or improper user_id"
}




▦ Datasets




/api/dataset/create

an endpoint to create datasets.

['POST']

POST method


curl -d '{"dataset_name": "sample dataset name", "dataset_description": "this is a sample dataset description", "dataset_size": "10-100MB", "dataset_format": "audio", "status": "private", "license_type": "Databoard Standard License"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/dataset/create -k



successful response, 200


{
   dataset_id: "855986cc-b49b-4f54-a57e-b535da0d0f71",
   message: "Dataset generated successfully"
}


error response, 400


{
   message: "Error: Invalid user_id, organization_id, user_auth_token, or organization_auth_token"
}




/api/dataset/delete

an endpoint to delete a dataset instance.

['POST']

POST method


curl -d '{"dataset_id": "855986cc-b49b-4f54-a57e-b535da0d0f71"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/dataset/delete -k



successful response, 200


{
   dataset: "new dataset name",
   dataset_id: "855986cc-b49b-4f54-a57e-b535da0d0f71",
   message: "Dataset deleted sucessfully"
}


error response, 400


{
   message_1: "Error: invalid userid or organization_id",
   message_2: "Error: the id entered is not an existing dataset_id"
}




/api/dataset/download

an endpoint to download datasets.

['POST']

POST method


curl "{{session['base_url']}}/api/dataset/download?user_id={{session['user_id']}}&user_auth_token={{session['user_auth_token']}}&organization_id={{session['organization_id']}}&organization_auth_token={{session['organization_auth_token']}}&dataset_id={{session['dataset_id']}}" --output {{session['dataset_id']}}.zip -k



successful response, 200


{
   output: ".zip file"
}


error response, 400


{
   message_1: "Error: invalid credentials (user_id/user_auth_token or organization_id/organization_auth_token)",
   message_2: "Error: invalid dataset_id"
}




/api/dataset/edit

an endpoint to edit dataset profile information.

['POST']

POST method


curl -d '{"dataset_id": "{{session['dataset_id']}}", "dataset_name": "new dataset name", "dataset_description": "new dataset description", "dataset_size": "10-100MB", "dataset_license_type": "Apache 2.0 License"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/dataset/edit -k



successful response, 200


{
   dataset_id: "855986cc-b49b-4f54-a57e-b535da0d0f71",
   message: "Successfully edited dataset"
}


error response, 400


{
   message_1: "Error: invalid userid/user_auth_token or organization_id/organization_auth_token",
   message_2: "Error: the id entered is not an existing dataset_id"
}




/api/dataset/read

an endpoint to get dataset profile information.

['POST']

POST method


curl -d '{"dataset_id": "{{session['dataset_id']}}"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/dataset/read -k



successful response, 200


{
   data_type: "audio",
   dataset_id: "855986cc-b49b-4f54-a57e-b535da0d0f71",
   dataset_size: 0,
   description: "this is a sample dataset description",
   download_number: 0,
   last_download_time: "Mon, 13 Jun 2022 16:22:56 GMT",
   last_export_file: null,
   license_type: "Databoard Standard License",
   limit: "10-100MB",
   name: "sample dataset name",
   notification_number: 0,
   operation_number: 0,
   organization_source: null,
   sample_number: 0,
   star_number: 1,
   status: "private",
   user_source: "3af319e1-def1-45a5-ab5e-2b99f8fdb94d",
   view_number: 0
}


error response, 400


{
   message_1: "Error: Invalid user_id, organization_id, user_auth_token, or organization_auth_token",
   message_2: "Error: the id entered is not an existing dataset_id"
}




/api/dataset/sample/create

an endpoint to upload data samples to datasets.

['POST']

POST method


curl -X POST {{session['base_url']}}/api/dataset/sample/create -F upload=@test.wav -F dataset_id={{session['dataset_id']}} -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' -k



successful response, 201


{
   message: "Successfully created sample",
   sample_id: "02459005-acc5-4cdd-a334-1a9d4f997dba"
}


error response, 400


{
   message_1: "Error: you have reached the organization operations limit",
   message_2: "Error: you have reached the organization storage limit",
   message_3: "Error: you have reached the dataset storage limit",
   message_4: "Error: you have reached the user operation limit",
   message_5: "Error: you have reached the user storage limit",
   message_6: "Error: userid/auth token or organization/auth token combination is invalid, or do not have sufficient permissions",
   message_7: "Error: file extension is not [extension] or .zip",
   message_8: "Error: dataset_id is invalid"
}




/api/dataset/sample/delete

an endpoint to delete data samples from datasets.

['POST']

POST method


curl -d '{"sample_id": "{{session['sample_id']}}"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/dataset/sample/delete -k



successful response, 201


{
   message: "Sample deleted successfully",
   sample_id: "02459005-acc5-4cdd-a334-1a9d4f997dba"
}


error response, 400


{
   message_1: "Error: userid/auth token or organization/auth token combination is invalid",
   message_2: "Error: dataset_id is invalid",
   message_3: "Error: sample_id is invalid"
}




/api/dataset/sample/operation/create

an endpoint to add operations to dataset samples

['POST']

POST method


curl -d '{"sample_id": "{{session['sample_id']}}", "operation_type": "[operation_type]"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/dataset/sample/operation/create -k



successful response, 201


{
   message: "Operation successful",
   operation_id: "02459005-acc5-4cdd-a334-1a9d4f997dba"
}


error response, 400


{
   message_1: "Error: userid/auth token or organization/auth token combination is invalid",
   message_2: "Error: dataset_id is invalid",
   message_3: "Error: sample_id is invalid"
}




/api/dataset/sample/operation/delete

an endpoint to delete operations from dataset samples.

['POST']

POST method


curl -d '{"sample_id": "{{session['sample_id']}}", "operation_id": "[operation_id]"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/dataset/sample/operation/delete -k



successful response, 201


{
   message: "Successfully deleted operation"
}


error response, 400


{
   message_1: "Error: userid/auth token or organization/auth token combination is invalid",
   message_2: "Error: dataset_id is invalid",
   message_3: "Error: sample_id is invalid",
   message_4: "Error: operation_id is invalid"
}




/api/dataset/sample/operation/read

an endpoint to read sample data operations.

['POST']

POST method


curl -d '{"sample_id": "{{session['sample_id']}}"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/dataset/sample/operation/read -k



successful response, 201


{
   dataset_id: "08b3d1ea-4814-4b31-bef2-31f4e01aad42",
   operations: {
      "3c445368-bed5-48ca-a23e-c721637ef806": {
         create_date: "2022-06-13 18:11:01.100326",
         message: "created sample",
         operation_id: "3c445368-bed5-48ca-a23e-c721637ef806"
      }
   },
   sample_create_date: "2022-06-13 18:11:01.100326",
   sample_id: "02459005-acc5-4cdd-a334-1a9d4f997dba",
   sample_last_edit: "Mon, 13 Jun 2022 18:11:01 GMT",
   sample_operations_number: 0
}


error response, 400


{
   message_1: "Error: userid/auth token or organization/auth token combination is invalid",
   message_2: "Error: dataset_id is invalid",
   message_3: "Error: sample_id is invalid"
}




/api/dataset/sample/read

an endpoint to read data samples from datasets.

['POST']

POST method


curl -d '{"sample_id": "{{session['sample_id']}}"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/dataset/sample/read -k



successful response, 201


{
   message: "Successfully read sample",
   sample_id: "02459005-acc5-4cdd-a334-1a9d4f997dba"
}


error response, 400


{
   message_1: "Error: userid/auth token or organization/auth token combination is invalid",
   message_2: "Error: dataset_id is invalid",
   message_3: "Error: sample_id is invalid"
}




/api/dataset/starred/create

an endpoint to star datasets.

['POST']

POST method


curl -d '{"dataset_id": "{{session['dataset_id']}}", "user_source": "[starred user_id]", "organization_source": "[starred organization_id]"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/dataset/starred/create -k



successful response, 201


{
   dataset_id: "855986cc-b49b-4f54-a57e-b535da0d0f71",
   message: "Dataset starred sucessfully"
}


error response, 400


{
   message_1: "Error: already starred dataset by organization",
   message_2: "Error: invalid userid or organizationid for user_source/organization_source",
   message_3: "Error: invalid auth token or userid or organization id",
   message_4: "Error: invalid dataset id"
}




/api/dataset/starred/delete

an endpoint to unstar datasets.

['POST']

POST method


curl -d '{"dataset_id": "{{session['dataset_id']}}", "user_source": "[starred user_id]", "organization_source": "[starred organization_id]"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/dataset/starred/delete -k



successful response, 201


{
   dataset_id: "855986cc-b49b-4f54-a57e-b535da0d0f71",
   message: "Unstarred dataset sucessfully"
}


error response, 400


{
   message_1: "Error: Cannot unstar; no star currently exists for given combination",
   message_2: "Error: invalid userid or organizationid for user_source/organization_source",
   message_3: "Error: invalid auth token or userid or organization id",
   message_4: "Error: invalid dataset id"
}




/api/datasets/starred

an endpoint to get a user's or organization's starred datasets.

['POST']

POST method


curl -d '{}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/datasets/starred -k



successful response, 201


{
   "084a45bb-1c33-41c0-b707-2a143455c2b9": {
      dataset_download_number: 0,
      dataset_id: "084a45bb-1c33-41c0-b707-2a143455c2b9",
      dataset_license_type: "Databoard Standard License",
      dataset_name: "sample dataset name",
      dataset_sample_number: 0,
      dataset_star_number: 1,
      dataset_status: "private",
      dataset_view_number: 0,
      organization_source: null,
      user_source: "3af319e1-def1-45a5-ab5e-2b99f8fdb94d"
   },
   "08b3d1ea-4814-4b31-bef2-31f4e01aad42": {
      dataset_download_number: 0,
      dataset_id: "08b3d1ea-4814-4b31-bef2-31f4e01aad42",
      dataset_license_type: "Databoard Standard license",
      dataset_name: "dsafsafdsa",
      dataset_sample_number: 0,
      dataset_star_number: 1,
      dataset_status: "private",
      dataset_view_number: 4,
      organization_source: null,
      user_source: "3af319e1-def1-45a5-ab5e-2b99f8fdb94d"
   }
}


error response, 400


{
   message: "Error: invalid user_id/user_auth_token or organization_id/organization_auth_token combination"
}



 Schemas




/api/schema/create

an endpoint to create schemas that can be enforced for datasets.

['POST']

POST method


curl -d '{"schema": {"test": "integer", "user": "string", "price": "float"}}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/schema/create -k



successful response, 200


{
   message: "Successfully created schema",
   schema: {
      price: "float",
      test: "integer",
      user: "string"
   },
   schema_id: "41c7ebab-fb65-4955-9db2-de4c8321b141"
}


error response, 400


{
   message_1: "Error: schema structure is malformed",
   message_2: "Error: credentials for user or organization are invalid"
}




/api/schema/delete

an endpoint to delete schemas.

['POST']

POST method


curl -d '{"schema_id": "purposefullybadid"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/schema/delete -k



successful response, 200


{
   message: "Successfully deleted schema",
   schema_id: "f4121bcf-a18c-4304-ae63-0dcaaed4401e"
}


error response, 400


{
   message_1: "Error: schema does not exist",
   message_2: "Error: credentials for user or organization are invalid"
}




/api/schema/edit

an endpoint to edit schemas.

['POST']

POST method


curl -d '{"schema_id": "f4121bcf-a18c-4304-ae63-0dcaaed4401e", "name": "new schema name", "description": "new schema description", "status": "public"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/schema/edit -k



successful response, 200


{
   message: "Successfully edited schema",
   schema_id: "f4121bcf-a18c-4304-ae63-0dcaaed4401e"
}


error response, 400


{
   message_1: "Error: schema does not exist",
   message_2: "Error: credentials for user or organization are invalid"
}




/api/schema/get

an endpoint to get dataset schemas.

['POST']

POST method


curl -d '{}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/schema/get -k



successful response, 200


{
   message: "Successfully received schemas",
   schemas: {
      "968ed108-8adc-4e3c-a6ad-b2745e51d3d7": {
         ljkllkk: "boolean"
      }
   }
}


error response, 400


{
   message: "Error: credentials for user or organization are invalid"
}




/api/schema/starred/create

an endpoint to star schemas.

['POST']

POST method


curl -d '{"schema_id": "{{session['schema_id']}}", "user_source": "[starred user_id]", "organization_source": "[starred organization_id]"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/schema/starred/create -k



successful response, 201


{
   message: "Survey starred sucessfully",
   schema_id: "855986cc-b49b-4f54-a57e-b535da0d0f71"
}


error response, 400


{
   message_1: "Error: already starred schema by organization",
   message_2: "Error: invalid userid or organizationid for user_source/organization_source",
   message_3: "Error: invalid auth token or userid or organization id",
   message_4: "Error: invalid schema id"
}




/api/schema/starred/delete

an endpoint to unstar schemas.

['POST']

POST method


curl -d '{"schema_id": "{{session['schema_id']}}", "user_source": "[starred user_id]", "organization_source": "[starred organization_id]"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/schema/starred/delete -k



successful response, 201


{
   message: "Unstarred schema sucessfully",
   schema_id: "855986cc-b49b-4f54-a57e-b535da0d0f71"
}


error response, 400


{
   message_1: "Error: Cannot unstar; no star currently exists for given combination",
   message_2: "Error: invalid userid or organizationid for user_source/organization_source",
   message_3: "Error: invalid auth token or userid or organization id",
   message_4: "Error: invalid schema id"
}




/api/schemas/starred

an endpoint to get a user's or organization's starred datasets.

['POST']

POST method


curl -d '{}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/schemas/starred -k



successful response, 201


{
   "41d04c3f-abd1-4b7b-b217-cab7b11233ad": {
      organization_source: null,
      schema_id: "41d04c3f-abd1-4b7b-b217-cab7b11233ad",
      schema_name: "asdfasf",
      user_source: "d55081ea-f1be-4f6d-afbb-c5998ae5fc02"
   }
}


error response, 400


{
   message: "Error: invalid user_id/user_auth_token or organization_id/organization_auth_token combination"
}



Surveys




/api/survey/create

an endpoint to create surveys.

['POST']

POST method


curl -d '{"name": "test survey", "description": "test survey description", "fragments": "{\"audio-772906da-0011-4406-96cf-aab00e153d18\":\"test audio fragment question\",\"date-bd543a5d-f042-4195-9337-192fe0234d02\":\"test date fragment question\",\"image-11664687-9b51-4f8a-b25a-351ef123476e\":\"test image fragment question\"}"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/survey/create -k



successful response, 200


{
   dataset_id: "de01483d-26ad-475a-8544-b3369e7b06df",
   fragments: {
      "audio-772906da-0011-4406-96cf-aab00e153d18": "test audio fragment question",
      "date-bd543a5d-f042-4195-9337-192fe0234d02": "test date fragment question",
      "image-11664687-9b51-4f8a-b25a-351ef123476e": "test image fragment question"
   },
   message: "Succesfully created survey",
   survey_id: "de01483d-26ad-475a-8544-b3369e7b06df"
}


error response, 400


{
   message: "Error: credentials for user or organization are invalid"
}




/api/survey/delete

an endpoint to delete surveys.

['POST']

POST method


curl -d '{"survey_id": "{survey_id}"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/survey/delete -k



successful response, 200


{
   message: "successfully deleted survey"
}


error response, 400


{
   message: "Error: credentials for user or organization are invalid"
}




/api/survey/edit

an endpoint to edit surveys.

['POST']

POST method


curl -d '{"survey_id": "{{survey_id}}", "name": "new survey name", "description": "new survey description", "status": "private"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/survey/edit -k



successful response, 200


{
   message: "successfully edited survey"
}


error response, 400


{
   message: "Error: credentials for user or organization are invalid"
}




/api/surveys/starred

an endpoint to get a user's or organization's starred datasets.

['POST']

POST method


curl -d '{}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/surveys/starred -k



successful response, 201


{
   "10e3e560-8ac5-4f10-a448-af89d9f06f7f": {
      organization_source: null,
      survey_id: "10e3e560-8ac5-4f10-a448-af89d9f06f7f",
      survey_name: "dsafsd",
      user_source: "d55081ea-f1be-4f6d-afbb-c5998ae5fc02"
   }
}


error response, 400


{
   message: "Error: invalid user_id/user_auth_token or organization_id/organization_auth_token combination"
}




/api/survey/starred/create

an endpoint to star surveys.

['POST']

POST method


curl -d '{"survey_id": "{{session['survey_id']}}", "user_source": "[starred user_id]", "organization_source": "[starred organization_id]"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/survey/starred/create -k



successful response, 201


{
   message: "Survey starred sucessfully",
   survey_id: "855986cc-b49b-4f54-a57e-b535da0d0f71"
}


error response, 400


{
   message_1: "Error: already starred survey by organization",
   message_2: "Error: invalid userid or organizationid for user_source/organization_source",
   message_3: "Error: invalid auth token or userid or organization id",
   message_4: "Error: invalid survey id"
}




/api/survey/starred/delete

an endpoint to unstar surveys.

['POST']

POST method


curl -d '{"survey_id": "{{session['survey_id']}}", "user_source": "[starred user_id]", "organization_source": "[starred organization_id]"}' -H 'Content-Type: application/json' -H 'Authorization: (u){{session['user_id']}}:{{session['user_auth_token']}}:(o){{session['organization_id']}}:{{session['organization_auth_token']}}' {{session['base_url']}}/api/survey/starred/delete -k



successful response, 201


{
   message: "Unstarred survey sucessfully",
   survey_id: "855986cc-b49b-4f54-a57e-b535da0d0f71"
}


error response, 400


{
   message_1: "Error: Cannot unstar; no star currently exists for given combination",
   message_2: "Error: invalid userid or organizationid for user_source/organization_source",
   message_3: "Error: invalid auth token or userid or organization id",
   message_4: "Error: invalid survey id"
}




/api/survey/upload

an endpoint to upload survey samples (example without file).

['POST']

POST method


curl -d '{"survey_id": "b73dca41-aac0-4ed8-8105-1878d0749b9f", "fragment_id": "8a5163bf-3dd8-49ba-9174-79cf85e74741", "session_id": "24c23f80-7eae-41e4-b189-28ee939064d6", "data": "2022-06-24", "metadata": "{\"this\": \"can\", \"be\": \"any\", \"key\": \"value\", \"pair\":\"wohooo\"}"}' -H 'Content-Type: application/json' {{session['base_url']}}/api/survey/upload -k



successful response, 200


{
   data: "2022-06-24",
   fragment_id: "8a5163bf-3dd8-49ba-9174-79cf85e74741",
   fragment_type: "date",
   message: "Succesfully uploaded fragment.",
   session_id: "b73dca41-aac0-4ed8-8105-1878d0749b9f",
   survey_id: "b73dca41-aac0-4ed8-8105-1878d0749b9f"
}


error response, 400


{
   message_1: "Error: the user or organization that created this survey is invalid or does not exist",
   message_2: "Error: survey_id is invalid or does not exist",
   message_3: "Error: fragment_id is invalid or does not exist",
   message_4: "Error: session_id is invalid or does not exist",
   message_5: "Error: an unexpected error occurred"
}




/api/survey/{survey_id}

an endpoint to view surveys (public).

['GET']

GET method


curl {{session['base_url']}}/api/survey/{survey_id} -k



successful response, 200


{
   fragments: [
      {
         fragment_id: "d2b6be61-ad21-47c3-99ee-d5f5e31eda8b",
         fragment_type: "audio",
         order_id: 0,
         question: "test audio fragment question"
      },
      {
         fragment_id: "f80530aa-bf66-47a6-a5a3-b81bab80e10d",
         fragment_type: "date",
         order_id: 1,
         question: "test date fragment question"
      },
      {
         fragment_id: "13df497e-409b-4009-a2f2-36194908d594",
         fragment_type: "image",
         order_id: 2,
         question: "test image fragment question"
      }
   ],
   message: "Succesfully viewed survey",
   survey_id: "de01483d-26ad-475a-8544-b3369e7b06df"
}


error response, 400


{
   message: "Error: survey_id is invalid or does not exist"
}





response colors





API Version

© Copyright Databoard Labs.
All Rights Reserved.