README
long_strange_trip_api
LongStrangeTripApi - JavaScript client for long_strange_trip_api This app is about you. All the places you've been, where you are now, and oh all 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
Node.js
Fornpm
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install long_strange_trip_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 long_strange_trip_api from, and run:
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
You should now be able to require('long_strange_trip_api')
in javascript files from the directory you ran the last
command above from.
git
https://github.com/YOUR_USERNAME/long_strange_trip_api then install it via:
If the library is hosted at a git repository, e.g. npm install YOUR_USERNAME/long_strange_trip_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 LongStrangeTripApi = require('long_strange_trip_api');
var defaultClient = LongStrangeTripApi.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 LongStrangeTripApi.DatasetsApi()
var owner = "weareudonishaslem"; // {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 = "blog-series"; // {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 LongStrangeTripApi.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 |
---|---|---|---|
LongStrangeTripApi.DatasetsApi | addFilesBySource | POST /datasets/{owner}/{id}/files | Add files |
LongStrangeTripApi.DatasetsApi | createDataset | POST /datasets/{owner} | Create a dataset |
LongStrangeTripApi.DatasetsApi | deleteDataset | DELETE /datasets/{owner}/{id} | Delete a dataset |
LongStrangeTripApi.DatasetsApi | deleteFileAndSyncSource | DELETE /datasets/{owner}/{id}/files/{name} | Delete a file |
LongStrangeTripApi.DatasetsApi | deleteFilesAndSyncSources | DELETE /datasets/{owner}/{id}/files | Delete files |
LongStrangeTripApi.DatasetsApi | getDataset | GET /datasets/{owner}/{id} | Retrieve a dataset |
LongStrangeTripApi.DatasetsApi | getDatasetByVersion | GET /datasets/{owner}/{id}/v/{versionId} | Retrieve a dataset by version |
LongStrangeTripApi.DatasetsApi | patchDataset | PATCH /datasets/{owner}/{id} | Update a dataset |
LongStrangeTripApi.DatasetsApi | replaceDataset | PUT /datasets/{owner}/{id} | Create / Replace a dataset |
LongStrangeTripApi.DatasetsApi | sync | POST /datasets/{owner}/{id}/sync | Sync files |
LongStrangeTripApi.DatasetsApi | syncViaGet | GET /datasets/{owner}/{id}/sync | Sync files (via GET) |
LongStrangeTripApi.DownloadApi | downloadDataset | GET /download/{owner}/{id} | Download dataset |
LongStrangeTripApi.DownloadApi | downloadFile | GET /file_download/{owner}/{id}/{file} | Download file |
LongStrangeTripApi.InsightsApi | createInsight | POST /insights/{projectOwner}/{projectId} | Create an insight |
LongStrangeTripApi.InsightsApi | deleteInsight | DELETE /insights/{projectOwner}/{projectId}/{id} | Delete an insight |
LongStrangeTripApi.InsightsApi | getInsight | GET /insights/{projectOwner}/{projectId}/{id} | Retrieve an insight |
LongStrangeTripApi.InsightsApi | getInsightByVersion | GET /insights/{projectOwner}/{projectId}/{id}/v/{versionId} | Retrieve an insight by version |
LongStrangeTripApi.InsightsApi | getInsightsForProject | GET /insights/{projectOwner}/{projectId} | Get insights for project. |
LongStrangeTripApi.InsightsApi | replaceInsight | PUT /insights/{projectOwner}/{projectId}/{id} | Replace an insight |
LongStrangeTripApi.InsightsApi | updateInsight | PATCH /insights/{projectOwner}/{projectId}/{id} | Update an insight |
LongStrangeTripApi.ProjectsApi | addLinkedDataset | PUT /projects/{owner}/{id}/linkedDatasets/{linkedDatasetOwner}/{linkedDatasetId} | Link dataset |
LongStrangeTripApi.ProjectsApi | createProject | POST /projects/{owner} | Create a project |
LongStrangeTripApi.ProjectsApi | deleteProject | DELETE /projects/{owner}/{id} | Delete a project |
LongStrangeTripApi.ProjectsApi | getProject | GET /projects/{owner}/{id} | Retrieve a project |
LongStrangeTripApi.ProjectsApi | getProjectByVersion | GET /projects/{owner}/{id}/v/{versionId} | Retrieve a project by version |
LongStrangeTripApi.ProjectsApi | patchProject | PATCH /projects/{owner}/{id} | Update a project |
LongStrangeTripApi.ProjectsApi | removeLinkedDataset | DELETE /projects/{owner}/{id}/linkedDatasets/{linkedDatasetOwner}/{linkedDatasetId} | Unlink dataset |
LongStrangeTripApi.ProjectsApi | replaceProject | PUT /projects/{owner}/{id} | Create / Replace a project |
LongStrangeTripApi.SparqlApi | sparqlGet | GET /sparql/{owner}/{id} | SPARQL query (via GET) |
LongStrangeTripApi.SparqlApi | sparqlPost | POST /sparql/{owner}/{id} | SPARQL query |
LongStrangeTripApi.SqlApi | sqlGet | GET /sql/{owner}/{id} | SQL query (via GET) |
LongStrangeTripApi.SqlApi | sqlPost | POST /sql/{owner}/{id} | SQL query |
LongStrangeTripApi.StreamsApi | appendRecords | POST /streams/{owner}/{id}/{streamId} | Append records to a stream. |
LongStrangeTripApi.UploadsApi | uploadFile | PUT /uploads/{owner}/{id}/files/{name} | Upload file |
LongStrangeTripApi.UploadsApi | uploadFiles | POST /uploads/{owner}/{id}/files | Upload files |
LongStrangeTripApi.UserApi | fetchContributingDatasets | GET /user/datasets/contributing | List datasets as contributor |
LongStrangeTripApi.UserApi | fetchContributingProjects | GET /user/projects/contributing | List projects as contributor |
LongStrangeTripApi.UserApi | fetchDatasets | GET /user/datasets/own | List datasets as owner |
LongStrangeTripApi.UserApi | fetchLikedDatasets | GET /user/datasets/liked | List liked datasets |
LongStrangeTripApi.UserApi | fetchLikedProjects | GET /user/projects/liked | List liked projects |
LongStrangeTripApi.UserApi | fetchProjects | GET /user/projects/own | List projects owned |
LongStrangeTripApi.UserApi | getAccount | GET /user/{account} | Get a user account info. |
LongStrangeTripApi.UserApi | getUserData | GET /user | Get user data |
Documentation for Models
- LongStrangeTripApi.CreateDatasetResponse
- LongStrangeTripApi.CreateInsightResponse
- LongStrangeTripApi.CreateProjectResponse
- LongStrangeTripApi.DatasetCreateRequest
- LongStrangeTripApi.DatasetPatchRequest
- LongStrangeTripApi.DatasetPutRequest
- LongStrangeTripApi.DatasetSummaryResponse
- LongStrangeTripApi.ErrorMessage
- LongStrangeTripApi.FileBatchUpdateRequest
- LongStrangeTripApi.FileCreateOrUpdateRequest
- LongStrangeTripApi.FileCreateRequest
- LongStrangeTripApi.FileSourceCreateOrUpdateRequest
- LongStrangeTripApi.FileSourceCreateRequest
- LongStrangeTripApi.FileSourceSummaryResponse
- LongStrangeTripApi.FileSummaryResponse
- LongStrangeTripApi.InsightBody
- LongStrangeTripApi.InsightCreateRequest
- LongStrangeTripApi.InsightPatchRequest
- LongStrangeTripApi.InsightPutRequest
- LongStrangeTripApi.InsightSummaryResponse
- LongStrangeTripApi.LinkedDatasetCreateOrUpdateRequest
- LongStrangeTripApi.LinkedDatasetSummaryResponse
- LongStrangeTripApi.OauthTokenReference
- LongStrangeTripApi.PaginatedDatasetResults
- LongStrangeTripApi.PaginatedInsightResults
- LongStrangeTripApi.PaginatedProjectResults
- LongStrangeTripApi.ProjectCreateRequest
- LongStrangeTripApi.ProjectPatchRequest
- LongStrangeTripApi.ProjectSummaryResponse
- LongStrangeTripApi.SuccessMessage
- LongStrangeTripApi.UserDataResponse
- LongStrangeTripApi.WebAuthorization
- LongStrangeTripApi.WebCredentials
Documentation for Authorization
token
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header