api

api

Members

(static) axios

Source:
Reference to the underlying axios package (https://www.npmjs.com/package/axios) Useful for creating new instances of axios if you want to create http requests to external APIs and not send tokens etc..
Example
const newRequest = await sdk.api.axios.get('https://otherapi.com/content/61eca4746971e75c1fc670cf');

Methods

(static) delete(endpoint, body, options)

Source:
Make a DELETE request to the API
Example
const result = await sdk.api.delete('/content/61eca4746971e75c1fc670cf');
Parameters:
Name Type Description
endpoint Object The endpoint to request
body Object The post body to send with the request
options Object The options to pass to axios for making the request

(static) generateEndpointURL(endpoint, params, options)

Source:
Generate an Endpoint URL, complete with authentication. this function is helpful for generating authenticated links for the user to open in another window
Example
const result = sdk.api.generateEndpointURL('/image/61eca4746971e75c1fc670cf', {
    w:100,
    h:50,
    }, {file:true})

// Would return something similar to:
// https://api.qik.dev/image/61eca4746971e75c1fc670cf?w=100&h=50&access_token=XXXX...
Parameters:
Name Type Description
endpoint String The endpoint to generate a url for
params Object Extra parameters for the url
options Object Additional request configuration
Properties
Name Type Description
withoutToken Object Don't append the current user's access token to the url
file Object Whether the response for this request is expected to be a binary file type

(static) get(endpoint, options)

Source:
Make a GET request to the API
Example
const result = await sdk.api.get('/user');
Parameters:
Name Type Description
endpoint Object The endpoint to request
options Object The options to pass to axios for making the request

(static) patch(endpoint, body, options)

Source:
Make a PATCH request to the API
Example
const result = await sdk.api.patch('/content/61eca4746971e75c1fc670cf', {title:'A new title'});
Parameters:
Name Type Description
endpoint Object The endpoint to request
body Object The post body to send with the request
options Object The options to pass to axios for making the request

(static) post(endpoint, body, options)

Source:
Make a POST request to the API
Example
const result = await sdk.api.post('/login', {username:'', password:''});
Parameters:
Name Type Description
endpoint Object The endpoint to request
body Object The post body to send with the request
options Object The options to pass to axios for making the request

(static) put(endpoint, body, options)

Source:
Make a PUT request to the API
Example
const result = await sdk.api.put('/content/61eca4746971e75c1fc670cf', {title:'A new title'});
Parameters:
Name Type Description
endpoint Object The endpoint to request
body Object The post body to send with the request
options Object The options to pass to axios for making the request