Skip to main content

EVA Services and Typings

The EVA backend exposes its services and their request and response types for your application. Our SDKs are based on these types. We strongly recommend coding in a strong typed language to take advantage of the Data Transfer Objects (DTO). These will also great assist in finding where deprecated features are being used.

The EVA API typings will be updated at least once a week. If you are looking to use the latest features and want to be prepared for any upcoming deprecations you should update these regularly. Preferably by using and updating one of the EVA SDKs.

Available services#

The EVA backend exposes the GetAvailableServices service. This service will return which services are available to the user making the call. Each service will be returned as such:

export interface Service {  Name: string;  Type: string;  Namespace: string;  AllowPublic: boolean;  AvailableOffline: boolean;}

An example service response looks like this:

{  "Name": "GetCurrentUser",  "Type": "EVA.Core.Services.Users.GetCurrentUser",  "Namespace": "Users",  "AllowPublic": true,  "AvailableOffline": true}

Access level#

Depending on the access level of the user making the call the amount of services returned can differ. The user making the call is determined using the authorization HTTP header. If omitted the default anonymous context is in effect.

Service definitions#

The EVA platform provides a typings endpoint which is used by the EVA SDKs to generate service definitions that can be used to make and provide typings for a call to the API. A service definition contains:

  • service name
  • request path
  • request type
  • response type

This is an example from the TypeScript SDK for the GetCurrentUser service:

/** * Return the current user for the given Authorization header * * @export * @class GetCurrentUser * @implements {EvaService} */export class GetCurrentUser implements IEvaServiceDefinition {  name = 'Core:GetCurrentUser';  path = '/api/core/GetCurrentUser';  request?: EVA.Core.GetCurrentUser;  response?: EVA.Core.GetCurrentUserResponse;}

Knowing the type of the request and response is obviously handy for compile time validation. It will also help with determining the impact of future changes, new features and checking for service deprecations.