Class API


  • public class API
    extends Object
    Simple interacting with VK API
    • Constructor Summary

      Constructors 
      Constructor Description
      API​(Client client)
      Get the token from client todo Not all methods available with group tokens, and few methods available without token todo Need to make client with both tokens, or any another conclusion
      API​(Auth auth)
      todo Not all methods available with group tokens, and few methods available without token todo Need to make client with both tokens, or any another conclusion
    • Constructor Detail

      • API

        public API​(Client client)
        Get the token from client todo Not all methods available with group tokens, and few methods available without token todo Need to make client with both tokens, or any another conclusion
        Parameters:
        client - Client with token
      • API

        public API​(Auth auth)
        todo Not all methods available with group tokens, and few methods available without token todo Need to make client with both tokens, or any another conclusion
        Parameters:
        auth - Auth object
    • Method Detail

      • call

        public void call​(String method,
                         Object params,
                         Callback<Object> callback)
        Call to VK API
        Parameters:
        method - Method name
        params - Params as string, JSONObject or Map
        callback - Callback to return the response
      • call

        public void call​(Callback<Object> callback,
                         String method,
                         Object... params)
        Call to VK API
        Parameters:
        callback - Callback to return the response
        method - Method name
        params - Floating count of params
      • execute

        public org.json.JSONObject execute​(String code,
                                           User user)
        Call to 'execute' method, because can not call API.execute inside execute. More: link;
        Parameters:
        code - code
        user - User object
        Returns:
        JSONObject response of VK answer
      • execute

        public void execute​(CallAsync... calls)
        Execute float count of calls, up to 25
        Parameters:
        calls - single call to VK API or calls separated by comma.
        See Also:
        CallAsync
      • execute

        public org.json.JSONArray execute​(User user,
                                          CallSync... calls)
        Execute float count of calls, up to 25
        Parameters:
        calls - single call to VK API or calls separated by comma.
        user - User object
        Returns:
        JSONArray with responses of calls
        See Also:
        CallSync
      • callSync

        public org.json.JSONObject callSync​(String method,
                                            Object params,
                                            Client user)
        Call to VK API
        Parameters:
        method - Method name
        params - Params as string, JSONObject or Map
        user - User object
        Returns:
        JSONObject response of VK answer
      • callSync

        public org.json.JSONObject callSync​(String method,
                                            Client user,
                                            Object... params)
        Call to VK API
        Parameters:
        method - Method name
        user - User object
        params - Floating count of params
        Returns:
        JSONObject response of VK answer