synapps v1.0.42
synapps
synapps - JavaScript client for synapps Synthetix (Public API)
Ahoy! Welcome aboard good ship Synthetix
The Synthetix Application Programming Platform or SYNAPPS is organized around REST. Our API has predictable, resource-oriented URLs, and error codes to indicate API errors. We use built-in HTTP features, like HTTP headers and HTTP verbs, which are understood by off-the-shelf HTTP clients.
We support cross-origin resource sharing, allowing you to interact securely with our API from a client-side web application (though you should never expose your secret API key in any public website's client-side code). JSON is returned by all API responses. This SDK is automatically generated by the OpenAPI Generator project:
- API version: 1.0.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
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 synapps --saveLocal 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 installNext, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:
npm linkFinally, switch to the directory you want to use your synapps from, and run:
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>You should now be able to require('synapps') 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/GIT_USER_ID/GIT_REPO_ID then install it via:
npm install GIT_USER_ID/GIT_REPO_ID --saveFor 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.jsThen 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 synapps = require('synapps');
var defaultClient = synapps.ApiClient.instance;
// Configure API key authorization: applicationkey
var applicationkey = defaultClient.authentications['applicationkey'];
applicationkey.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//applicationkey.apiKeyPrefix['applicationkey'] = "Token"
// Configure Bearer access token for authorization: bearerAuth
var bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
// Configure API key authorization: consumerkey
var consumerkey = defaultClient.authentications['consumerkey'];
consumerkey.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//consumerkey.apiKeyPrefix['consumerkey'] = "Token"
var api = new synapps.EnvironmentApi()
var inlineObject = new synapps.InlineObject(); // {InlineObject}
api.createConstant(inlineObject).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});Documentation for API Endpoints
All URIs are relative to https://api.synthetix.com/2.0
| Class | Method | HTTP request | Description |
|---|---|---|---|
| synapps.EnvironmentApi | createConstant | POST /environment/constants | |
| synapps.EnvironmentApi | createVariable | POST /environment/variables | |
| synapps.EnvironmentApi | deleteVariable | DELETE /environment/variables | |
| synapps.EnvironmentApi | editVariable | PATCH /environment/variables | |
| synapps.EnvironmentApi | getVariable | GET /environment/variables | |
| synapps.ExternalApi | addArticleFeedback | POST /external/article_feedback | |
| synapps.ExternalApi | addArticleRating | POST /external/article_rate | |
| synapps.ExternalApi | addBreadcrumb | POST /external/breadcrumb | |
| synapps.ExternalApi | addCategory | POST /external/categories | |
| synapps.ExternalApi | createAdvert | POST /external/ad_serve | |
| synapps.ExternalApi | createReport | POST /external/report | |
| synapps.ExternalApi | createSession | POST /external/session | |
| synapps.ExternalApi | deleteSession | DELETE /external/session | |
| synapps.ExternalApi | editSession | PATCH /external/session | |
| synapps.ExternalApi | endChat | POST /external/end | |
| synapps.ExternalApi | fetchAllFAQS | GET /external/all_faqs | |
| synapps.ExternalApi | fetchArticle | POST /external/article | |
| synapps.ExternalApi | fetchBreadcrumb | GET /external/breadcrumb | |
| synapps.ExternalApi | fetchFullFAQS | GET /external/full_faqs | |
| synapps.ExternalApi | fetchSelfConfig | GET /external/self_configure | |
| synapps.ExternalApi | fetchSessionTrail | GET /external/session_trail | |
| synapps.ExternalApi | fetchTrigger | GET /external/trigger | |
| synapps.ExternalApi | fetchViews | GET /external/views | |
| synapps.ExternalApi | fetchWebhook | GET /external/webhook | |
| synapps.ExternalApi | getSession | GET /external/session | |
| synapps.ExternalApi | runSearch | POST /external/search | |
| synapps.ExternalApi | updateTrigger | PUT /external/trigger |
Documentation for Models
Documentation for Authorization
applicationkey
- Type: API key
- API key parameter name: applicationkey
- Location: HTTP header
bearerAuth
- Type: Bearer authentication
consumerkey
- Type: API key
- API key parameter name: consumerkey
- Location: HTTP header
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago