Group Invites

Schema Schema

The schema defines all the fields that exist for a group invite object.

id

integer
A unique numeric ID for the BP Invitation object.
Read only
Context: viewedit
user_id

integer
The ID of the user who is invited to join the Group.
Context: viewedit
invite_sent

boolean
Whether the invite has been sent to the invitee.
Context: viewedit
inviter_id

integer
The ID of the user who made the invite.
Context: viewedit
group_id

integer
The ID of the group to which the user has been invited.
Context: viewedit
date_modified

string,
date-time
The date the object was created or last updated, in the site’s timezone.
Context: viewedit
type

string
Invitation or request.
Context: viewedit
One of: inviterequest
message

object
The raw and rendered versions for the content of the message.
Context: viewedit

Top ↑

List the Group Invites List the Group Invites

Arguments Arguments

NameTypeDescription
contextstringScope under which the request is made; determines fields present in response.
Default: view
One of: view, edit
pageintegerCurrent page of the collection.
Default: 1
per_pageintegerMaximum number of items to be returned in result set.
Default: 10
group_idintegerID of the group to limit results to.
Default: 0
user_idintegerReturn only invitations extended to this user.
Default: 0
inviter_idintegerReturn only invitations extended by this user.
Default: 0
invite_sentstringLimit result set to invites that have been sent, not sent, or include all.
Default: sent
One of : draft, sent, all

Top ↑

Definition Definition

GET /buddypress/v1/groups/invites

Top ↑

Example of Use Example of Use

Alert: To use the bp.apiRequest function, you need to enqueue the bp-api-request JavaScript or use it as a dependency of your script. Refer to this page to know more about loading JavaScript files in WordPress.
bp.apiRequest( {
  path: 'buddypress/v1/groups/invites',
  type: 'GET',
  data: {
    context: 'view',
    group_id: 3
  }
} ).done( function( data ) {
  return data;
} ).fail( function( error ) {
  return error;
} );

Top ↑

Invite a user to join a Group Invite a user to join a Group

Top ↑

Arguments Arguments

NameTypeDescription
user_idintegerThe ID of the user who is invited to join the Group.
Required
inviter_idintegerThe ID of the user who made the invite.
Default: the current logged in user ID.
group_idintegerThe ID of the group to which the user has been invited.
Required
messagestringThe optional message to send to the invited user.
send_invitebooleanWhether the invite should be sent to the invitee.
Default: true

Top ↑

Definition Definition

POST /buddypress/v1/groups/invites

Top ↑

Example of use Example of use

Alert: To use the bp.apiRequest function, you need to enqueue the bp-api-request JavaScript or use it as a dependency of your script. Refer to this page to know more about loading JavaScript files in WordPress.

bp.apiRequest( {
  path: 'buddypress/v1/groups/invites',
  type: 'POST',
  data: {
    context: 'edit',
    user_id: 13,
    group_id: 7,
    message: 'Join the BuddyPress Contributors Group'
  }
} ).done( function( data ) {
  return data;
} ).fail( function( error ) {
  return error;
} );

Top ↑

Retrieve a specific Group Invite Retrieve a specific Group Invite

Top ↑

Arguments Arguments

NameTypeDescription
invite_idintegerA unique numeric ID for the group invitation.
Required
contextstringScope under which the request is made; determines fields present in response.
Default: view
One of : view, edit

Top ↑

Definition Definition

GET /buddypress/v1/groups/invites/<invite_id>

Top ↑

Example of use Example of use

Alert: To use the bp.apiRequest function, you need to enqueue the bp-api-request JavaScript or use it as a dependency of your script. Refer to this page to know more about loading JavaScript files in WordPress.

bp.apiRequest( {
  path: 'buddypress/v1/groups/invites/5',
  type: 'GET',
  data: {
    context: 'view'
  }
} ).done( function( data ) {
  return data;
} ).fail( function( error ) {
  return error;
} );

Top ↑

Accept a specific Group Invite Accept a specific Group Invite

Top ↑

Arguments Arguments

NameTypeDescription
invite_idintegerA unique numeric ID for the group invitation.
Required

Top ↑

Definition Definition

PUT /buddypress/v1/groups/invites/<invite_id>

Top ↑

Example of use Example of use

Alert: To use the bp.apiRequest function, you need to enqueue the bp-api-request JavaScript or use it as a dependency of your script. Refer to this page to know more about loading JavaScript files in WordPress.

bp.apiRequest( {
  path: 'buddypress/v1/groups/invites/5',
  type: 'PUT',
  data: {
    context: 'edit'
  }
} ).done( function( data ) {
  return data;
} ).fail( function( error ) {
  return error;
} );

Top ↑

Reject or remove a specific Group Invite Reject or remove a specific Group Invite

Note: If the invited user is the logged in user then the Group Invite will be rejected. Otherwise the uninvite action will be used.

Top ↑

Arguments Arguments

NameTypeDescription
invite_idintegerA unique numeric ID for the group invitation.
Required

Top ↑

Definition Definition

DELETE /buddypress/v1/groups/invites/<invite_id>

Top ↑

Example of use Example of use

Alert: To use the bp.apiRequest function, you need to enqueue the bp-api-request JavaScript or use it as a dependency of your script. Refer to this page to know more about loading JavaScript files in WordPress.

bp.apiRequest( {
  path: 'buddypress/v1/components',
  type: 'GET',
  data: {
    context: 'view'
  }
} ).done( function( data ) {
  return data;
} ).fail( function( error ) {
  return error;
} );