Hi, the current rest routes used by our plugin are defined in https://github.com/perfectyorg/perfecty-push-wp/blob/master/public/class-perfecty-push-public.php#L90-L123
However they will change in 1.7.0, so please have the upcoming change in mind:
// JS SDK friendly routes
register_rest_route(
'perfecty-push',
'/v1/webpush/(?P<site_id>[a-zA-Z0-9-]+)/subscribers',
array(
'methods' => array( 'POST' ),
'callback' => array( $users, 'register' ),
'permission_callback' => '__return_true',
'args' => array( 'site_id' => array() ),
)
);
register_rest_route(
'perfecty-push',
'/v1/webpush/(?P<site_id>[a-zA-Z0-9-]+)/subscribers/(?P<id>[a-zA-Z0-9-]+)/unregister',
array(
'methods' => array( 'POST' ),
'callback' => array( $users, 'unregister' ),
'permission_callback' => '__return_true',
'args' => array(
'site_id' => array(),
'subscriber_id' => array(),
),
)
);
register_rest_route(
'perfecty-push',
'/v1/webpush/(?P<site_id>[a-zA-Z0-9-]+)/subscribers/(?P<id>[a-zA-Z0-9-]+)',
array(
'methods' => array( 'GET' ),
'callback' => array( $users, 'get_user' ),
'permission_callback' => '__return_true',
'args' => array(
'site_id' => array(),
'subscriber_id' => array(),
),
)
);
Thread Starter
medio1
(@medio1)
Thank you. That’s enough.
Please don’t forget to list the changes of rest routes in the changelog.
Good luck!