☁️
Calendly Salesforce SDK
  • Getting Started
  • Core Concepts
    • Pagination
    • Error Handling
  • Classes
    • CalendlyApi
      • Organization
        • OrganizationMembership
          • OrganizationMembershipCollection
          • OrganizationMembershipResource
          • OrganizationMembershipPagination
          • OrganizationMembershipQueryParams
        • OrganizationInvitation
          • OrganizationInvitationResource
          • OrganizationInvitationCollection
          • OrganizationInvitationPagination
          • OrganizationInvitationQueryParams
      • User
        • UserResource
      • Invitee
        • InviteeResource
        • InviteeCollection
        • InviteeQueryParams
        • InviteePagination
        • InviteeQuestionsAndAnswer
        • InviteeTracking
        • InviteeCancellation
        • InviteePayment
      • ScheduledEvent
        • ScheduledEventPagination
        • ScheduledEventQueryParams
        • ScheduledEventCollection
        • ScheduledEventResource
        • EventMembership
        • EventGuest
        • ScheduledEventLocation
        • InviteesCounter
      • EventType
        • EventTypePagination
        • EventTypeQueryParams
        • EventTypeCollection
        • EventTypeResource
        • EventTypeProfile
      • SchedulingLink
      • WebhookSubscription
        • WebhookSubscriptionQueryParams
        • WebhookSubscriptionResource
        • WebhookSubscriptionCollection
        • WebhookSubscriptionPagination
        • VerifyWebhookResult
        • WebhookPayload
        • CreateWebhookSubscriptionRequest
      • SortParam
  • Advanced Concepts
    • Create Apex controller to receive webhook payload
Powered by GitBook
On this page

Was this helpful?

  1. Core Concepts

Pagination

Methods that return a collection will include a pagination attribute which can be used to retrieve the next page of results (if available).

try {    
    CalendlyApi.OrganizationMembershipQueryParams params = new CalendlyApi.OrganizationMembershipQueryParams();
    CalendlyApi.OrganizationMembershipCollection result = organization.getOrganizationMemberships(params);
    
    List<CalendlyApi.OrganizationMembership> memberships = new List<CalendlyApi.OrganizationMembership>();
    memberships.addAll(result.collection);
    
    Boolean hasNextPage = result.pagination.hasNextPage();
    
    while (hasNextPage) {
    	result = result.pagination.nextPage();
        memberships.addAll(result.collection);
        hasNextPage = result.pagination.hasNextPage();
    }
    
    System.debug('Memberships: ' + memberships);
} catch (CalendlyApi.CalendlyApiException e) {
    System.debug('Error');
    System.debug(e.message);
    System.debug(e.title);
}
PreviousGetting StartedNextError Handling

Last updated 4 years ago

Was this helpful?