Skip to content
REST API Javascript SDK
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
LICENSE
README.md
bower.json
vidal-api.js

README.md

Vidal-api.js

To kickstart your project into calling the Vidal API.

Getting started

Preliminary steps

  1. Make sure your 3scale access is properly configured. If so, you should know your application ID (e.g. "MY_APP_ID") and access key (e.g. "MY_APP_KEY").
  2. Then, all you need to do is include the following Javascript file (latest version): https://softwarevidal.github.io/vidal-api.js/vidal-api.js
  3. Alternatively, you can run bower install vidal-api.js

Finally, you can try the following examples and tailor them to your needs. Please note they are run against our BETA environment, please contact editeurs AT vidal DOT net for further information.

GET requests

  1. include https://softwarevidal.github.io/vidal-api.js/vidal-api.js (latest version)

var callback = function(xmlDoc) {
    // awesome callback here
};

VidalApiFactory
    .create('MY_APP_ID', 'MY_APP_KEY')
    .get("http://apirest-beta.vidal.fr/rest/api/molecules?startwith=a", callback);

POST requests

  1. include vidal-api.js

    2.

var callback = function(xmlDoc) {
    // awesome callback here
},
    contents = "\
<?xml version='1.0' encoding='UTF-8' standalone='yes'?> \
<prescription> \
    <!-- etc etc --> \
</prescription>";
    // default payload type is: 'application/x-www-form-urlencoded'
    payload = PayloadFactory.create(contents, "text/xml");

VidalApiFactory
    .create('MY_APP_ID', 'MY_APP_KEY')
    .post("http://apirest-beta.vidal.fr/rest/api/alerts", callback, payload);

Troubleshooting

Please feel free to open an issue, with as many details as possible.

Something went wrong with that request. Please try again.