the-whole-world v0.0.2
my_worlds_api
MyWorldsApi - JavaScript client for my_worlds_api This app is about you. Everywhere youve been, now, ... the places you'll go. This SDK is automatically generated by the Swagger Codegen project:
- API version: 0.0.1
- Package version: 0.0.1
- Build package: io.swagger.codegen.languages.JavascriptClientCodegen For more information, please visit https://github.com/weareudonishaslem/
Installation
For Node.js
npm
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install my_worlds_api --save
Local development
To use the library locally without publishing to a remote npm registry, first install the dependencies by changing
into the directory containing package.json
(and this README). Let's call this JAVASCRIPT_CLIENT_DIR
. Then run:
npm install
Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR
:
npm link
Finally, switch to the directory you want to use your my_worlds_api from, and run:
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
You should now be able to require('my_worlds_api')
in javascript files from the directory you ran the last
command above from.
git
If the library is hosted at a git repository, e.g. https://github.com/YOUR_USERNAME/my_worlds_api then install it via:
npm install YOUR_USERNAME/my_worlds_api --save
For browser
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify
,
perform the following (assuming main.js is your entry file, that's to say your javascript file where you actually
use this library):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.
Webpack Configuration
Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
Getting Started
Please follow the installation instruction and execute the following JS code:
var MyWorldsApi = require('my_worlds_api');
var defaultClient = MyWorldsApi.ApiClient.instance;
// Configure API key authorization: token
var token = defaultClient.authentications['token'];
token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//token.apiKeyPrefix['Authorization'] = "Token"
var api = new MyWorldsApi.DatasetsApi()
var owner = "owner_example"; // {String} User name and unique identifier of the creator of a dataset or project. For example, in the URL: [https://data.world/jonloyens/an-intro-to-dataworld-dataset](https://data.world/jonloyens/an-intro-to-dataworld-dataset), jonloyens is the unique identifier of the owner.
var id = "id_example"; // {String} Dataset unique identifier. For example, in the URL:[https://data.world/jonloyens/an-intro-to-dataworld-dataset](https://data.world/jonloyens/an-intro-to-dataworld-dataset), an-intro-to-dataworld-dataset is the unique identifier of the dataset.
var body = new MyWorldsApi.FileBatchUpdateRequest(); // {FileBatchUpdateRequest}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.addFilesBySource(owner, id, body, callback);
Documentation for API Endpoints
All URIs are relative to https://api.data.world/v0
Class | Method | HTTP request | Description |
---|---|---|---|
MyWorldsApi.DatasetsApi | addFilesBySource | POST /datasets/{owner}/{id}/files | Add files |
MyWorldsApi.DatasetsApi | createDataset | POST /datasets/{owner} | Create a dataset |
MyWorldsApi.DatasetsApi | deleteDataset | DELETE /datasets/{owner}/{id} | Delete a dataset |
MyWorldsApi.DatasetsApi | deleteFileAndSyncSource | DELETE /datasets/{owner}/{id}/files/{name} | Delete a file |
MyWorldsApi.DatasetsApi | deleteFilesAndSyncSources | DELETE /datasets/{owner}/{id}/files | Delete files |
MyWorldsApi.DatasetsApi | getDataset | GET /datasets/{owner}/{id} | Retrieve a dataset |
MyWorldsApi.DatasetsApi | getDatasetByVersion | GET /datasets/{owner}/{id}/v/{versionId} | Retrieve a dataset by version |
MyWorldsApi.DatasetsApi | patchDataset | PATCH /datasets/{owner}/{id} | Update a dataset |
MyWorldsApi.DatasetsApi | replaceDataset | PUT /datasets/{owner}/{id} | Create / Replace a dataset |
MyWorldsApi.DatasetsApi | sync | POST /datasets/{owner}/{id}/sync | Sync files |
MyWorldsApi.DatasetsApi | syncViaGet | GET /datasets/{owner}/{id}/sync | Sync files (via GET) |
MyWorldsApi.DownloadApi | downloadDataset | GET /download/{owner}/{id} | Download dataset |
MyWorldsApi.DownloadApi | downloadFile | GET /file_download/{owner}/{id}/{file} | Download file |
MyWorldsApi.InsightsApi | createInsight | POST /insights/{projectOwner}/{projectId} | Create an insight |
MyWorldsApi.InsightsApi | deleteInsight | DELETE /insights/{projectOwner}/{projectId}/{id} | Delete an insight |
MyWorldsApi.InsightsApi | getInsight | GET /insights/{projectOwner}/{projectId}/{id} | Retrieve an insight |
MyWorldsApi.InsightsApi | getInsightByVersion | GET /insights/{projectOwner}/{projectId}/{id}/v/{versionId} | Retrieve an insight by version |
MyWorldsApi.InsightsApi | getInsightsForProject | GET /insights/{projectOwner}/{projectId} | Get insights for project. |
MyWorldsApi.InsightsApi | replaceInsight | PUT /insights/{projectOwner}/{projectId}/{id} | Replace an insight |
MyWorldsApi.InsightsApi | updateInsight | PATCH /insights/{projectOwner}/{projectId}/{id} | Update an insight |
MyWorldsApi.ProjectsApi | addLinkedDataset | PUT /projects/{owner}/{id}/linkedDatasets/{linkedDatasetOwner}/{linkedDatasetId} | Link dataset |
MyWorldsApi.ProjectsApi | createProject | POST /projects/{owner} | Create a project |
MyWorldsApi.ProjectsApi | deleteProject | DELETE /projects/{owner}/{id} | Delete a project |
MyWorldsApi.ProjectsApi | getProject | GET /projects/{owner}/{id} | Retrieve a project |
MyWorldsApi.ProjectsApi | getProjectByVersion | GET /projects/{owner}/{id}/v/{versionId} | Retrieve a project by version |
MyWorldsApi.ProjectsApi | patchProject | PATCH /projects/{owner}/{id} | Update a project |
MyWorldsApi.ProjectsApi | removeLinkedDataset | DELETE /projects/{owner}/{id}/linkedDatasets/{linkedDatasetOwner}/{linkedDatasetId} | Unlink dataset |
MyWorldsApi.ProjectsApi | replaceProject | PUT /projects/{owner}/{id} | Create / Replace a project |
MyWorldsApi.SparqlApi | sparqlGet | GET /sparql/{owner}/{id} | SPARQL query (via GET) |
MyWorldsApi.SparqlApi | sparqlPost | POST /sparql/{owner}/{id} | SPARQL query |
MyWorldsApi.SqlApi | sqlGet | GET /sql/{owner}/{id} | SQL query (via GET) |
MyWorldsApi.SqlApi | sqlPost | POST /sql/{owner}/{id} | SQL query |
MyWorldsApi.StreamsApi | appendRecords | POST /streams/{owner}/{id}/{streamId} | Append records to a stream. |
MyWorldsApi.UploadsApi | uploadFile | PUT /uploads/{owner}/{id}/files/{name} | Upload file |
MyWorldsApi.UploadsApi | uploadFiles | POST /uploads/{owner}/{id}/files | Upload files |
MyWorldsApi.UserApi | fetchContributingDatasets | GET /user/datasets/contributing | List datasets as contributor |
MyWorldsApi.UserApi | fetchContributingProjects | GET /user/projects/contributing | List projects as contributor |
MyWorldsApi.UserApi | fetchDatasets | GET /user/datasets/own | List datasets as owner |
MyWorldsApi.UserApi | fetchLikedDatasets | GET /user/datasets/liked | List liked datasets |
MyWorldsApi.UserApi | fetchLikedProjects | GET /user/projects/liked | List liked projects |
MyWorldsApi.UserApi | fetchProjects | GET /user/projects/own | List projects owned |
MyWorldsApi.UserApi | getAccount | GET /user/{account} | Get a user account info. |
MyWorldsApi.UserApi | getUserData | GET /user | Get user data |
Documentation for Models
- MyWorldsApi.CreateDatasetResponse
- MyWorldsApi.CreateInsightResponse
- MyWorldsApi.CreateProjectResponse
- MyWorldsApi.DatasetCreateRequest
- MyWorldsApi.DatasetPatchRequest
- MyWorldsApi.DatasetPutRequest
- MyWorldsApi.DatasetSummaryResponse
- MyWorldsApi.ErrorMessage
- MyWorldsApi.FileBatchUpdateRequest
- MyWorldsApi.FileCreateOrUpdateRequest
- MyWorldsApi.FileCreateRequest
- MyWorldsApi.FileSourceCreateOrUpdateRequest
- MyWorldsApi.FileSourceCreateRequest
- MyWorldsApi.FileSourceSummaryResponse
- MyWorldsApi.FileSummaryResponse
- MyWorldsApi.InsightBody
- MyWorldsApi.InsightCreateRequest
- MyWorldsApi.InsightPatchRequest
- MyWorldsApi.InsightPutRequest
- MyWorldsApi.InsightSummaryResponse
- MyWorldsApi.LinkedDatasetCreateOrUpdateRequest
- MyWorldsApi.LinkedDatasetSummaryResponse
- MyWorldsApi.OauthTokenReference
- MyWorldsApi.PaginatedDatasetResults
- MyWorldsApi.PaginatedInsightResults
- MyWorldsApi.PaginatedProjectResults
- MyWorldsApi.ProjectCreateRequest
- MyWorldsApi.ProjectPatchRequest
- MyWorldsApi.ProjectSummaryResponse
- MyWorldsApi.SuccessMessage
- MyWorldsApi.UserDataResponse
- MyWorldsApi.WebAuthorization
- MyWorldsApi.WebCredentials
Documentation for Authorization
token
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
6 years ago