Goto APIs

MCP API

General:

Basics:

Base-URL: https://capi.lagerkoll.com/v1/mcp/
Parameters in the url should all be encoded and all data sent should be UTF-8

MAX number of requests per minute is set to 200.
When the limit is hit an error with code 429 is returned, with the header "Retry-After" containing the number of seconds you have to wait for your next request.

Headers:

There are 2 ways to be authenticated when using this API. in both ways you add headers to the request.
1) Use an API-key together with store-id. This would be used when communicating machine to machine and no real person is involved. The API-key is available from where you activated the API. The store-id is also available in the same place.
2) Use a user_id and user_token together with a store-id. You get these values from the login-request. The values are connected to a person and are gained when an actual login to the system has been made.
store: <<STORE>>
user_id: <<USER_ID>>
user_token: <<USER_TOKEN>>
api_key: <<API_KEY>>
Accept: application/json
Content-Type: application/json

Errors:

Code Description
900001 Credentials don't match
900101 Common error
900429 Too many requests
{
  "errorCode" : 900101,
  "errorMessage" : "Something went wrong on the server",
  "errorField" : null,
  "errorData" : null
}

MCP API:

MCP

MCP options

OPTIONSUrl:
Headers:
Options request
Body:
Successfull response:

MCP stream

GETUrl:
Headers:
Accept: text/event-stream
Open stream to client
Body:
Successfull response:

Create session

POSTUrl: /session
Headers:
Accept: application/json
Content-type: application/json
Create session to OpenAI
Body:

{"userId": "userId"}
Successfull response:

{"sessionId": "sessionId"}

MCP entry

POSTUrl:
Headers:
Accept: application/json
Content-type: application/json
Entry point to MCP Server
Body:

{ "method": "method", "id": 4780, "params": { "name": "name", "arguments": {} } }
Successfull response:

{ "result": {}, "id": 1066, "jsonrpc": "jsonrpc", "error": { "code": 3803, "message": "message" } }

MCP close

DELETEUrl:
Headers:
Close stream for client
Body:
Successfull response:

Classes:

JsonRPCErrorDto

Field Type Description Default Mandatory Accepted values Example values Access
code Integer R,W
message String R,W

JsonRPCRequestDto

Field Type Description Default Mandatory Accepted values Example values Access
id Long R,W
method String R,W
params JsonRPCRequestParamsDto R,W

JsonRPCRequestParamsDto

Field Type Description Default Mandatory Accepted values Example values Access
name String R,W
arguments Map R,W

JsonRPCResponseDto

Field Type Description Default Mandatory Accepted values Example values Access
jsonrpc String R,W
id Long R,W
result IJsonRPCResultDto R,W
error JsonRPCErrorDto R,W

OpenAISessionRequestDto

Field Type Description Default Mandatory Accepted values Example values Access
userId String POST R,W

OpenAISessionResponseDto

Field Type Description Default Mandatory Accepted values Example values Access
sessionId String R,W