Lokad API version 2


Important

This page is not intended to be an introduction to web-services technologies but a technical reference documentation. For an introduction, please refer to SOAP article on Wikipedia. For the API documentation and tutorials, you can check the Lokad API product page.

Development

.NET development

.NET developers do not have to use this service endpoint directly. There is a Lokad .NET Software Development Kit that provides .NET-friendly wrappers for the API methods along with reliability and request validation logics. All paging and request slicing is performed by Lokad SDK libraries automatically.

Cross-platform development

Additional information on the cross-platform development with this API could be found on the Lokad API Product Page.

Lokad APIv2 Request Limitations and Validation Rules

Request Limitatitions

In order to improve overall experience of all customers, Lokad APIv2 places a certain size limitations on the amount data that could be processed with a single request. You could find specific values below.

Developers leveraging Lokad SDK for .NET do not have to worry about these limits, as they are taken care of internally.

API Limit: AddSeries = 1000

Series per request in ILokadApi.AddSeries(Identity,SerieInfo[])

API Limit: AddTasks = 5000

Tasks per request in ILokadApi.AddTasks(Identity,TaskInfo[])

API Limit: DeleteSeries = 1000

Series per request in ILokadApi.DeleteSeries(Identity,Guid[])

API Limit: DeleteTasks = 2000

Tasks per request in ILokadApi.DeleteTasks(Identity,Guid[])

API Limit: GetEvents_Series = 1000

Series per request in ILokadApi.GetEvents(Identity,Guid[])

API Limit: GetForecasts = 50

Forecasts per request in ILokadApi.GetForecasts(Identity,Guid[])

API Limit: GetSegments_Series = 1000

Segments per request in ILokadApi.GetSerieSegments(Identity,Guid[],SegmentCursor,Int32)

API Limit: GetSeries_Page = within 100 and 1000

Allowed page size in ILokadApi.GetSeries(Identity,Guid,Int32)

API Limit: GetSeriesByPrefix_Page = within 100 and 750

Limit for the page size in ILokadApi.GetSeriesByPrefix(Identity,String,Guid,Int32)

API Limit: GetSerieSegments_Page = within 250 and 25000

Allowed page size in ILokadApi.GetSerieSegments(Identity,Guid[],SegmentCursor,Int32)

API Limit: GetTags_Series = 1000

Series per request in ILokadApi.GetTags(Identity,Guid[])

API Limit: GetTasks_Page = within 100 and 1000

Allowed page size in ILokadApi.GetTasks(Identity,Guid,Int32)

API Limit: GetTasks_Series = 1000

Tasks per request in ILokadApi.GetTasksBySerieIDs(Identity,Guid[])

API Limit: SetEvents_EventsPerRequest = 2500

Events per request in ILokadApi.SetEvents(Identity,EventsForSerie[])

API Limit: SetEvents_Series = 1000

Series per request in ILokadApi.SetEvents(Identity,EventsForSerie[])

API Limit: SetTags_Series = 1000

Series per request in ILokadApi.SetTags(Identity,TagsForSerie[])

API Limit: SetTags_TagsPerRequest = 7000

Tags per request in ILokadApi.SetTags(Identity,TagsForSerie[])

API Limit: UpdateSerieSegments_Segments = 1000

Segments per request in ILokadApi.UpdateSerieSegments(Identity,SegmentForSerie[])

API Limit: UpdateSerieSegments_Values = 100000

Values per request in ILokadApi.UpdateSerieSegments(Identity,SegmentForSerie[])

API Limit: UpdateTasks = 2000

Tasks per request in ILokadApi.UpdateTasks(Identity,TaskInfo[])

Validation Rules

Lokad APIv2 enforces a certain set of business and validation rules upon all data sent into the system. You can find these rules below.

API Rule: Endpoint

Endpoint should be hosted on Lokad servers and represent a valid connection string.

API Rule: Event

SerieEvent.Name should have length within 1 and 32 characters and comply with the ApiRules.ValidName. SerieEvent.Time should pass ApiRules.ValidDate rule. SerieEvent.DurationDays should be a non-negative valid double that is smaller than 10^6. SerieEvent.KnownSince should either be empty or pass ApiRules.ValidDate rule.

API Rule: Events

EventsForSerie.SerieID should be set to a valid value, while every item in the array should comply with the ApiRules.Event rule.

API Rule: Identity

Idenity should have Username according to the ApiRules.UserName rule and password that is valid within the ApiRules.Passwordrule.

API Rule: IllegalCharacters

Characters that are invalid in the names of tags, events, series etc: ;[]<>\/#?+

API Rule: NewSerie

New serie should have SerieInfo.SerieID that is not set and SerieInfo.Name that passes ApiRules.SerieName rule.

API Rule: NewTask

New task should have TaskInfo.TaskID that is not set and should comply with the ApiRules.TaskBody rule.

API Rule: Password

Password should have length within 1 and 256 characters

API Rule: Report

Report should have a valid Subject (length within 5 and 256 characters) and a valid Message (length within 2 and 4000 characters)

API Rule: Segment

Segment should have SegmentForSerie.SerieID set to a valid identifier. Each item within SegmentForSerie.Values should pass ApiRules.Value rule.

API Rule: Segments

Segments array should have legth limited by LokadApiRequestLimits.UpdateSerieSegments_Segments while the total value should be less than LokadApiRequestLimits.UpdateSerieSegments_Values. Each segment should comply with the ApiRules.Segment rule and have SerieId that is unique within this call.

API Rule: SerieName

Name of a serie must comply with ApiRules.ValidName rule and have lentgth within 1 and 64 characters.

API Rule: SetEvents

While setting the events, number of items in the array should be less than LokadApiRequestLimits.SetEvents_Series, while the total number of events should be less than LokadApiRequestLimits.SetEvents_EventsPerRequest. Each array item should comply with the ApiRules.SetEvents rule.

API Rule: SetTags

While setting tags, array of TagsForSerie should have length limited by LokadApiRequestLimits.SetTags_Series, while the totak number of tags should be less than LokadApiRequestLimits.SetTags_TagsPerRequest. Every item in the array should be valid according to the ApiRules.Tags rule.

API Rule: Tags

TagsForSerie.SerieID should be set to a valid value, while every tag in the array should comply with the ApiRules.ValidTag rule.

API Rule: Task

Existing task should have TaskInfo.TaskID that is set to a valid value and should comply with the ApiRules.TaskBody rule.

API Rule: TaskBody

Task should have TaskInfo.Period and TaskInfo.SerieID with set values. TaskInfo.PeriodStart must pass ApiRules.ValidDate. TaskInfo.FuturePeriods should be within a valid range as defined by ApiRules.ValidateFuturePeriods.

API Rule: UserName

User name should have length within 6 and 256 characters and should be a valid email.

API Rule: ValidateFuturePeriods

TaskInfo.FuturePeriods should be greater than 0 and less than 64 for all periods, with the following exceptions: Period.QuarterHour - 6*7*24, Period.HalfHour - 6*7*24*2, Period.Hour - 6*7*24.

API Rule: ValidConnection

Each connection should have ServiceConnection.Username passing the ApiRules.UserName rule, while ServiceConnection.Password passes the ApiRules.Password rule and an ServiceConnection.Endpoint is valid according to the ApiRules.Endpoint rule.

API Rule: ValidDate

All dates should represent a valid MS SQL date. They must be represented in culture invariant format and be greater than 1753-01-01.

API Rule: ValidName

Name can't have IllegalCharacters and must be valid for XMLSerialization.

API Rule: ValidTag

Name of the tag must be comply with ApiRules.ValidName and should have length within 1 and 32 characters.

API Rule: Value

TimeValue.Value should represent a valid double, while TimeValue.Time should pass the ApiRules.ValidDate rule.

Lokad APIv2 Methods

The following operations are supported. For a formal definition, please review the Service Description.