This article will go over how to get a list of users from the API that meet the following criteria:
- User is not in "Pending" status
- User has the "Speaker" role assigned
- User has "Accepted" session(s)
- Include the associated Session information
Let's get started!
Getting Speakers
Use this API call:
GET https://ngapi.hubb.meapi/v1/[eventId]/Users?$expand=SpeakingAt&$filter=IsPending eq false and indexof(Roles,'Speaker') gt -1 and SpeakingAt/any()
Let's break down the query parameters:
- $expand=SpeakingAt
- This is to show you the Speaker's session information.
- This will return the Session Title (string) and SessionId (int).
- $filter=IsPending eq false
- This is to filter out users who are in "Pending" status.
- $filter=indexof(Roles,'Speaker') gt -1
- This is to filter out users who do not have the "Speaker" role.
- $filter=SpeakingAt/any()
- This is to filter our Speakers who are in "confirmed" status, but do not have an "Accepted" session.
- This is a concern for users who have multiple roles.
- For example, if a user has both Speaker and Grader roles, they will be in a "confirmed" status (IsPending=false) even though they do not have an "Accepted" session.
- This is to filter our Speakers who are in "confirmed" status, but do not have an "Accepted" session.
Comments
Please sign in to leave a comment.