Authentication
API Token
- Shell
- JavaScript
- Python
- Java
- iOS
- Android
- C#
To authorize, use this code
# with curl, there's no need to authorize separately -- just pass your API token in with every call
curl -X POST -H "Content-Type: application/json" \
-d '{"item_name":"xyz","keywords":["k1","k2"]}' \
-u "[your API token]:" https://ac.cnstrc.com/v1/item
// Client side Javascript
const KrestorIOClient = require("@Krestor-io/Krestorio-client-javascript");
const Krestorio = new KrestorIOClient({
apiKey: "YOUR API KEY",
});
// Node
const KrestorIOClient = require("@Krestor-io/Krestorio-node");
const Krestorio = new KrestorIOClient({
apiKey: "YOUR API KEY",
apiToken: "YOUR API TOKEN",
});
from Krestor_io.Krestor_io import KrestorIO
Krestorio = KrestorIO({
"api_key": "YOUR API KEY",
})
import io.Krestor.client.*;
String apiToken = "[your API token]";
String apiKey = "[your API key]";
KrestorIO Krestorio = new KrestorIO(apiToken, apiKey, true, null);
// Create the client config
let config = KrestorIOConfig(
apiKey: "YOUR API KEY",
)
// Create the client instance
let Krestor = KrestorIO(config: config)
KrestorIO Krestor = new KrestorIO("apitoken", "apikey", true, null);
// This method is not currently supported.
note
Make sure to replace [your API token]
with your API token from your dashboard.
You authenticate to the REST API by providing your API token, which you can obtain from your dashboard.
Authentication is done using HTTP Basic Auth. Provide your API token as the basic auth username in every request. You do not need to provide a password. All API requests must be made over HTTPS.
Verification
- Shell
- JavaScript
- Python
- Java
- iOS
- Android
- C#
curl -u "[your API token]:" "https://ac.cnstrc.com/v1/verify?key=[your API key]"
// This method is not currently supported.
# This method is not currently supported.
// This method is not currently supported.
// This method is not currently supported.
// This method is not currently supported.
// This method is not currently supported.
You can verify that authentication works correctly by issuing a simple verification request.
HTTP Request
GET https://ac.cnstrc.com/v1/verify?key=[your API key]