2019-10-27 13:31:59 +00:00
|
|
|
/* global axios */
|
|
|
|
import ApiClient from '../ApiClient';
|
|
|
|
|
|
|
|
class FBChannel extends ApiClient {
|
|
|
|
constructor() {
|
2020-03-28 06:13:02 +00:00
|
|
|
super('facebook_indicators', { accountScoped: true });
|
2019-10-27 13:31:59 +00:00
|
|
|
}
|
|
|
|
|
2019-12-28 16:26:42 +00:00
|
|
|
create(params) {
|
|
|
|
return axios.post(
|
2020-03-28 06:13:02 +00:00
|
|
|
`${this.url.replace(this.resource, '')}callbacks/register_facebook_page`,
|
2019-12-28 16:26:42 +00:00
|
|
|
params
|
|
|
|
);
|
|
|
|
}
|
2020-09-29 19:42:32 +00:00
|
|
|
|
|
|
|
reauthorizeFacebookPage({ omniauthToken, inboxId }) {
|
|
|
|
return axios.post(`${this.baseUrl()}/callbacks/reauthorize_page`, {
|
|
|
|
omniauth_token: omniauthToken,
|
|
|
|
inbox_id: inboxId,
|
|
|
|
});
|
|
|
|
}
|
2019-10-27 13:31:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default new FBChannel();
|