Question

I'm trying to get list of events, a particular user has signed up for. Note: i can get my-events, but then i need to login as user :( Adobe Connect API user guide says this: Given a user’s login or principal-id, this action returns the list of events that the user attended Now do I get list of Events User is going to attend - is signed up for? ...

main()
{
   //login as adiminstrator
   ConnectAPI connectApi = new ConnectAPI(@"http://domain.adobeconnect.com","user@domain.com", "Password", "");
   var listOfEventsJson = getUsersAttendedEvents("someUser@email.com", "someAccountId");
   Console.WriteLine( listOfEventsJson );
}

I get an empty Json list when I use

private String getUsersAttendedEvents(string login, string accountId)
        {
            if (_bzsession == "")
            Login();
            string queryString = "login=" + login +
                                 "&account-id=" + accountId;
            var result = Request("events-attendance", queryString);
            return JsonConvert.SerializeXmlNode(result, Newtonsoft.Json.Formatting.Indented);
        }

response result is this:

{
  "results": {
    "?xml": {
      "@version": "1.0",
      "@encoding": "utf-8"
    },
    "results": {
      "status": {
        "@code": "no-data"
      }
    }
      }
    }

thanks in advance

Was it helpful?

Solution

my solution is to run thrue all events and after run thrue events users and compare users, do you have better one!? Couse this takes time to run thrue all thouse loops: here is my own solution:

public List<String> getUserAtendedEvents(String userEmail)
    {
        // get all upcoming Events Sco ID's
        var scoIds = getAllEventsDataToClass().ScoIds;

        List<String> userEvents = new List<string>();

        // request Connect for Event info
        // action=report-event-participants-complete-information&sco-id=1418245799
        for (int i = 0; i < scoIds.Count; i++)
        {
            XDocument req = RequestXDoc("report-event-participants-complete-information", "sco-id=" + scoIds[i]);
            var emails = req.Descendants().Attributes("login"); // ---- login emails

            foreach (var email in emails)
            {
                if (email.Value.Equals(userEmail))
                {
                    userEvents.Add(scoIds[i]);
                }
            }
        }
        return userEvents;

    }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top