-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Learnosity/feature/add-events-api-support
[FEATURE] Add events api support
- Loading branch information
Showing
3 changed files
with
74 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using System; | ||
using System.Text; | ||
using LearnositySDK.Request; | ||
using LearnositySDK.Utils; | ||
|
||
namespace LearnositySDK.Examples | ||
{ | ||
public class Events | ||
{ | ||
|
||
public static string Simple() | ||
{ | ||
string service = "events"; | ||
|
||
JsonObject security = new JsonObject(); | ||
security.set("consumer_key", "yis0TYCu7U9V4o7M"); | ||
security.set("user_id", "demo_student"); | ||
security.set("domain", "localhost"); | ||
|
||
string secret = "74c5fd430cf1242a527f6223aebd42d30464be22"; | ||
|
||
JsonObject request = new JsonObject(); | ||
request.set("eventbus", true); | ||
request.set("skip", true); | ||
request.set("users", Events.users()); | ||
|
||
Init init = new Init(service, security, secret, request); | ||
return init.generate(); | ||
} | ||
|
||
private static JsonObject users() | ||
{ | ||
JsonObject users = new JsonObject(true); | ||
|
||
for (int i = 0; i <= 10; i++) | ||
{ | ||
string user_id = "userid_" + i; | ||
users.set(user_id); | ||
} | ||
|
||
return users; | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters