feat: Implement twilio connection

This commit is contained in:
Faruk AYDIN
2022-10-25 20:03:08 +02:00
committed by Ali BARIN
parent 8fb58cf662
commit 30d2740368
5 changed files with 177 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import { IGlobalVariable } from '@automatisch/types';
const verifyCredentials = async ($: IGlobalVariable) => {
try {
await $.http.get('/2010-04-01/Accounts.json?PageSize=1', {
auth: {
username: $.auth.data.accountSid as string,
password: $.auth.data.authToken as string,
},
});
await $.auth.set({
screenName: $.auth.data.accountSid,
});
} catch (error) {
throw new Error(JSON.stringify(error.response.data));
}
};
export default verifyCredentials;