+}
+
+struct json_object *ws_reply_get_content(struct json_object *rp)
+{
+ return json_object_object_get(rp, "content");
+}
+
+struct json_object *ws_execute(struct json_object *rq)
+{
+ struct json_object *rp, *content;
+
+ rp = http_json_get(session_url, rq);
+
+ if (rp) {
+ content = ws_reply_get_content(rp);
+
+ if (content && !json_object_object_get(rp, "error"))
+ return content;
+
+ json_object_put(rp);
+ }
+
+ return NULL;
+}
+
+int ws_get_api_version()
+{
+ struct json_object *rp, *rq, *j;
+ int v;
+
+ rq = ws_request_new("getApiLevel");