Class API
- java.lang.Object
-
- com.github.stormbit.sdk.utils.vkapi.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 conclusionAPI(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
-
Method Summary
Modifier and Type Method Description voidcall(Callback<Object> callback, String method, Object... params)Call to VK APIvoidcall(String method, Object params, Callback<Object> callback)Call to VK APIorg.json.JSONObjectcallSync(String method, Client user, Object... params)Call to VK APIorg.json.JSONObjectcallSync(String method, Object params, Client user)Call to VK APIorg.json.JSONArrayexecute(User user, CallSync... calls)Execute float count of calls, up to 25voidexecute(CallAsync... calls)Execute float count of calls, up to 25org.json.JSONObjectexecute(String code, User user)Call to 'execute' method, because can not call API.execute inside execute.
-
-
-
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 nameparams- Params as string, JSONObject or Mapcallback- 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 responsemethod- Method nameparams- 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- codeuser- 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 nameparams- Params as string, JSONObject or Mapuser- User object- Returns:
- JSONObject response of VK answer
-
-