1.0.42 • Published 2 years ago

synapps v1.0.42

Weekly downloads
-
License
Unlicense
Repository
-
Last release
2 years ago

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 --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 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 --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 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

ClassMethodHTTP requestDescription
synapps.EnvironmentApicreateConstantPOST /environment/constants
synapps.EnvironmentApicreateVariablePOST /environment/variables
synapps.EnvironmentApideleteVariableDELETE /environment/variables
synapps.EnvironmentApieditVariablePATCH /environment/variables
synapps.EnvironmentApigetVariableGET /environment/variables
synapps.ExternalApiaddArticleFeedbackPOST /external/article_feedback
synapps.ExternalApiaddArticleRatingPOST /external/article_rate
synapps.ExternalApiaddBreadcrumbPOST /external/breadcrumb
synapps.ExternalApiaddCategoryPOST /external/categories
synapps.ExternalApicreateAdvertPOST /external/ad_serve
synapps.ExternalApicreateReportPOST /external/report
synapps.ExternalApicreateSessionPOST /external/session
synapps.ExternalApideleteSessionDELETE /external/session
synapps.ExternalApieditSessionPATCH /external/session
synapps.ExternalApiendChatPOST /external/end
synapps.ExternalApifetchAllFAQSGET /external/all_faqs
synapps.ExternalApifetchArticlePOST /external/article
synapps.ExternalApifetchBreadcrumbGET /external/breadcrumb
synapps.ExternalApifetchFullFAQSGET /external/full_faqs
synapps.ExternalApifetchSelfConfigGET /external/self_configure
synapps.ExternalApifetchSessionTrailGET /external/session_trail
synapps.ExternalApifetchTriggerGET /external/trigger
synapps.ExternalApifetchViewsGET /external/views
synapps.ExternalApifetchWebhookGET /external/webhook
synapps.ExternalApigetSessionGET /external/session
synapps.ExternalApirunSearchPOST /external/search
synapps.ExternalApiupdateTriggerPUT /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
1.0.42

2 years ago

1.0.39

2 years ago

1.0.38

2 years ago

1.0.40

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.41

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.33

2 years ago

1.0.32

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.37

2 years ago

1.0.36

2 years ago

1.0.35

2 years ago

1.0.34

2 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.0

3 years ago