private String TestDataInserted(ProxomoApi api) { ContinuationTokens ct = new ContinuationTokens(string.Empty, string.Empty); //get back all the data in a specified table List<MyCustomData> lcd = api.CustomDataSearch<MyCustomData>("MyCustomTable", string.Empty, 20, ref ct); String s = ""; //if there is no such table, create and insert data then get the data back to display if (lcd == null || lcd.Count == 0) { GenerateData(api); lcd = api.CustomDataSearch<MyCustomData>("MyCustomTable", string.Empty, 20, ref ct); } //print the data to web page foreach (var item in lcd) { s += item.Data + " | "; } return s; }
/** * Update person attributes */ private void UpdatePerson1(Person p, ProxomoApi api) { // the followings are required for notification p.EmailAddress = "*****@*****.**"; p.EmailAlerts = true; p.EmailVerified = true; p.EmailVerificationStatus = VerificationStatus.Complete; p.EmailVerificationCode = "123456"; p.MobileVerified = true; api.PersonUpdate(p); }
/** * Sample code for notification */ private void NotificationSample(ProxomoApi api, Person p) { Notification n = new Notification(); n.PersonID = p.ID; n.EMailMessage = "your friend request has been accepted"; n.EMailSubject = "Friend req status"; n.SendMethod = NotificationSendMethod.EMail; n.NotificationType = NotificationType.EventInvite; n.EMailMessage = "email mess"; n.EMailSubject = "email subject"; api.NotificationSend(n); }
private void GenerateData(ProxomoApi api) { //MyCustomData represent the schema of the data you want to add MyCustomData cd = new MyCustomData(); //some sample data for (int i = 0; i < 5; i++) { cd.TableName = "MyCustomTable"; cd.Data = "data " + i; cd.ID = ""; cd.Date = DateTime.Today.AddDays(i); //call api.CustomDataAdd to add data api.CustomDataAdd<MyCustomData>(cd); } }
/** * Sample code for Friend */ private void FriendSample(ProxomoApi api, Person p, Person p2) { //invite friend api.FriendInvite(p.ID, p2.ID); //respond to friend request api.FriendshipRespond(FriendResponse.Accept, p.ID, p2.ID); }
/** * Create the 2nd person */ private Person CreatePerson2(ProxomoApi api) { PersonLogin pl = new PersonLogin(); try { pl = api.SecurityPersonCreate("abc", "abc", "admin"); } catch { } Person p = null; if (pl.PersonID == null) { UserToken ut = api.SecurityPersonAuthenticate("abc", "abc"); p = api.PersonGet(ut.PersonID); } else p = api.PersonGet(pl.PersonID); return p; }
private void Connect_Click(object sender, RoutedEventArgs e) { initializeButtonState(); // Make sure user has entered the unique values assigned when they registered their app in the App Manager if ((applicationID == "<YOUR APP ID HERE>") || (ProxomoAPIkey == "<YOUR APP ID HERE>")) { ConnectionStatus.Text = "The applicationID and ProxomoAPIkey values are not correct. Search for the comment'Enter the unique values for your app here' on this demo and enter the TWO unique values generated by the Proxomo App Manager when you registered your app."; //throw new Exception("The applicationID and ProxomoAPIkey values are not correct. Search for 'YOUR PROXOMO API KEY HERE' on this demo and enter the TWO unique values generated by the Proxomo App Manager when you registered your app."); } else { // This next call will be make to behave synchronously so it will nto return until Initialization is completed... WP7SDKInstance = new ProxomoApi(applicationID, ProxomoAPIkey, "V09", CommunicationType.JSON, true); ConnectionStatus.Text = "Connecting...."; // Enable the front panel options so user can now run methods.... Dispatcher.BeginInvoke(() => ConnectionStatus.Text = "Connected"); Dispatcher.BeginInvoke(() => ProxomoMethodList.IsEnabled = true); Dispatcher.BeginInvoke(() => RunButton.IsEnabled = true); Dispatcher.BeginInvoke(() => Login.IsEnabled = true); } }