Cannot make API work - getting permission errors. Any examples? Any documentation?

  • Last Post 22 September 2020
damago1 posted this 20 September 2020

Hello, I am trying to use API and it is not working. First I am making Api call to LOGIN and it seems that I am getting some success. I am getting answer:


But when I want to make any other call, for instance to GetLocalInstances I get the following reply:

{"Error":true,"Title":"Unauthorized Access","Message":"You do not have permission to use this method (WebMethods.GetAMPUsersSummary) at this time. This method requires the Session.Exists permission.","StackTrace":"\n  at GSMyAdmin.WebServer.WebAttributes.InvokeMethod (String MethodName, Newtonsoft.Json.Linq.JObject Data, m.Http.IHttpRequest request, ModuleShared.IWebSession Session, ModuleShared.WebMethodsBase MethodsClass, String RawRequest) \n  at GSMyAdmin.WebServer.APIService.InvokeAPI (m.Http.IHttpRequest request, ModuleShared.IWebSession Session, Newtonsoft.Json.Linq.JObject Data, String RequestModule, String RequestMethod, String RawRequest) "}

To the second call I am passing the whole answer from the first call. Herre is my call (bash script):

RESPONSE=$( curl \
        --header "Accept: application/json" \
        --request POST \
        --data "$TOKEN" \ )

The $TOKEN is replaced by the response from the first 'login' call, which is in fact almost identical, only theurl is different and json is taken from article on using the API. In audit logs I do see that the user zabbix is correctly logged in. User zabbix is added to super-admins group so it should have ALL permissions. the API documentation is very poor. Only a short article without any examples. The description of the keys is not helping either (only key name and very very short listing of available parameters without even one sentence what it does.

Order By: Standard | Newest | Votes
Mike posted this 20 September 2020

Are you feeding back the login token you get given with subsequent requests?

I'd also recommend using one of the official APIs if possible, such as the NodeJS library found here:

damago1 posted this 21 September 2020

Yes. As a $TOKEN I am passing either the whole response from first call:


or only the:


None of those works.

Mike posted this 21 September 2020

Look at the documentation on the front page of the API endpoint. It tells you what data you need to send back with an example.

damago1 posted this 22 September 2020

Ok. Managed to make it work. For anybody who will encounter the same problem:

the SESSIONID has to be in CAPITAL LETTERS despite being returned in mixed case from login call. So the correct format to be sent to subsequent commands is:


I have some more questions:

  • how to obtain information if minecraft instance is sleeping? In ADSModule/GetInstanceStatuses or ADSModule/GetInstances there is a field Running but it is always true (both when minecraft is sleeping and when it is awaken. There is also field AppStatus but it is always -1 also there is Core/GetStatus which has "Active Users" field but it's RawValue is always 0, and percent is very huge negative numer.

  • how to obtain minecraft users count (active logged in users count) or list for minecraft instances? There is a call Core/GetUserList but it is always returning empty list despite people being logged into minecraft instances.

My goal is to monitor AMP Minecraft servers with zabbix and I need basic diagnostic info like which instances are not sleeping, how many users are currently active on the server and if possible get periodically active minecraft users list.

damago1 posted this 22 September 2020

Ok. I found it too:

The documentation is VERY confusing in this respect.

  1. you have to connect to the exact instance you want to check users in. So give port number of specific application when logging in or making API calls. You cannot use the port number or Instance Manager.

  2. you can use the API CALL:

Core/GetUserList - this returns simply a list of users


Core/GetStatus - here you will have inside information on the users too, in the form of a number :

example output:

 "CPU Usage":{"RawValue":0,"MaxValue":100,"Percent":0,"Units":"%","Color":"#EDC240","Color2":"","Color3":"#000"}, 
"Memory Usage":{"RawValue":0,"MaxValue":1024,"Percent":0,"Units":"MB","Color":"#AFD8F8"},
"Active Users":{"RawValue":0,"MaxValue":10,"Percent":0,"Units":"","Color":"#CB4B4B"},