BaseApi
Interfaces
SuccessResponse
SuccessResponseinterface SuccessResponse {
success: boolean,
message: string
}Members
The User that this API is associated with.
apiUrl : string
apiUrl : stringThe base URL of this API.
Methods
constructor(user, apiUrl)
constructor(user, apiUrl)This should only get called by classes that inherit the BaseApi class.
usershould be an instance of theUserobject.apiUrlshould be the base API URL.
class SomeVulosIdentityApi extends BaseApi {
constructor(user, endpoint) {
super(user, endpoint + '/api/v1/some_api')
}
}
const someApi = new SomeVulosIdentityApi(user, endpoint)async request(url, method = 'get', data = null, cachePrefix = null)
async request(url, method = 'get', data = null, cachePrefix = null)Preform an authenticated request to the API.
const response = await someApi.request('endpoint', 'put', { key: 'value' }, 'some:endpoint')Last updated