Twilio Connect

文章推薦指數: 80 %
投票人數:10人

Twilio Connect lets your customers grant you access to their Twilio accounts so that your application — your 'Connect App' — can buy phone numbers, ... TwilioDocs SMS Voice Runtime Video Studio Alldocs... SDKs Help Login Signup SMS Voice Runtime Video Studio Alldocs... SDKs Help Login Signup IdentityandAccessManagement(IAM) Twilio Menu GettingStarted Overview TestCredentials AccountsandProjects Accounts Subaccounts Organizations Organizations ManagedAccounts ManagedUsers Domains KeysandTokens APIKeyResource APIKeysandAccessTokens Credentials RESTAPI:Credentials PublicKeyResource PublicKeyClientValidation Overview GettingStarted AccountandKeyManagementwithAPIKeys SingleSign-On Overview TwilioConnect Overview RESTAPI:ConnectApps RESTAPI:AuthorizedConnectApps Quickstarts C#/.NET Java PHP Python Ruby Collapse Expand Ratethispage: ConnectApplimitationsConnectAppsdonothaveaccesstothefullfunctionalityofferedbyTwilioservices.PleaseseeTwilioConnectLimitationsforfulldetails. SignupFlowInorderforacustomertoauthorizeyourConnectApptheymusthavepreviouslycreatedandupgradedTwilioaccount. Overview TwilioConnectletsyourcustomersgrantyouaccesstotheirTwilioaccountssothatyourapplication—your‘ConnectApp’—canbuyphonenumbers,makephonecalls,andsendSMS.BecauseyourcustomersareusingtheirownTwilioaccount,youdon’tneedtoworryaboutbillingthemfortheirusageofTwilioservices:Twiliowillchargeyourcustomerdirectly. Additionally,userscangrantyourConnectAppaccesstotheirTwiliocallandSMSlogdata.Withthisinformation,youcanimplementanalyticsandotherread-onlyuse-cases. Wanttogetstartedrightaway?JumprightinwithourTwilioConnectQuickstarts. ManageyourConnectApps CreateConnectAppsusingtheAppspageintheConsole. YoumayupdateyourConnectAppsthroughthesamepage,orwiththeConnectRESTAPI. OnlyupgradedaccountscancreateConnectApps. Howitworks WhencreatingyourConnectApps,therearetwodifferentpermissionsyoucanrequestfromyourusers: Chargeaccountforusageallowsyourapplicationtobuyphonenumbers,makephonecalls,sendtextmessages,andperformothertasksthatresultinTwiliobillingtheuserdirectly. Readallaccountdataallowsyourapplicationtoaccesscall,SMS,andotherlogsforanalyticsandotherread-onlyuse-cases. Thesepermissionsarenotmutuallyexclusive.YouselectbothChargeaccountforusageandReadallaccountdatawhensettingupyourConnectApp,orselectoneatthestartandaddthesecondlater.However,ifyouchangeyourConnectApppermissions,youwillnotbeabletouseanynewpermissionuntiltheuserreauthorizesyourConnectApp. Seethepermissionssection,below,formoredetails. WhenyoucreateyourConnectApp,youwillbegivenasnippetofHTMLtodropintoyourwebpage.ThisHTMLwilldisplayaConnectbuttonthatuserscanclicktoauthorizeyourConnectApptousetheirTwilioaccount.Ifauserdoesn’tyethaveaTwilioaccount,theywillbepromptedtosignup. WhenauserclickstheConnectbutton,theywillbeaskedtoauthorizeyourConnectAppaccordingtothepermissionsyouselectedwhenyousettheAppup.AftertheuserauthorizesyourConnectApp,TwiliowillredirecttheirbrowsertoaURLthatyouspecifyduringsetup:theAuthorizeURLunderEndpoints.ThisredirectwillincludeAccountSidasaGETquerystringparameter.ThevalueofAccountSidistheSIDofansub-accountsetupundertheuser’sTwilioaccount.YouauthenticateConnectrequestsmadebyyourappwiththatAccountSIDandyourownAuthToken. IfyouaddaquerystringparametercalledstatetothetargetURLoftheConnectbutton,TwiliowillalsopassthatparameterbackintherequestitmakestoyourAuthorizeURL.Thisparameterisusefulforpassingmetadata,likeacustomer’susernameorsomeotheruniqueidentifier,toyourcloud. IfyouhaveChargeaccountforusagepermission("post-all"intheAPI),youcanmakePOSTrequeststotheuser’saccount’ssubresourceURLstobuynumbers,makephonecalls,andsendSMSmessagesontheirbehalf. IfyouhaveReadallaccountdataaccess("get-all"intheAPI),youcanmakeGETrequeststothe/accountsendpointtoseealltheuser’saccounts.YoucanalsomakeGETrequeststoanysubresourceownedbythoseaccounts. Helperlibraries YoucanusetheexistingTwiliohelperlibrariestomakeauthorizedrequeststoyourusers’Twilioaccounts.JustusetheAccountSidvalueprovidedbytherequestTwiliomakestoyourAuthorizeURLaftertheuserhasgrantedyourConnectAppaccessrights. Bestpractices TwilioConnectisanewwayofthinkingaboutyourapplications.HerearesomebestpracticesthatyoushouldfollowtomakesureyourConnectAppisbothsecureanderror-free. Do DoplaceyourConnectbuttonbehindsomeformofauthentication TwilioConnectallowsend-userstoauthorizeyourapplicationtomake requestsontheirbehalf,butitdoesnotserveasanauthenticationmechanism foryourend-users.Assuch,yourapplicationshouldprovideitsown authenticationmechanism.Formoreinformationpleasereadthe Howitworkssection. WhenpresentingyourConnectbutton,youshouldinformusersthat TwiliowillbillthemdirectlyforyourConnectApp’svoiceandSMSusage. DoredirecttoanotherpageafteryourAuthorizeURL YourAuthorizeURLshouldonlybeusedbyyourConnectApp.Wewillpassyour user’sAccountSIDtoyourAuthorizeURL.Afteryoustoretheuser’sAccountSID, youshouldredirecttheusertoafollow-onpage. DohaveaDeauthorizeURL WhenauserrevokespermissionyourConnectApp’spermissions,TwiliowillmakeanHTTP requesttoanyURLyouspecifiedasaDeauthorizeCallbackURLvalue.Youshouldusethis requesttoupdatedyouruserdatabasetoreflectthelossofpermissions. DohaveaFAQ IncludeaFAQtoletyourcustomersknowtheytheyarerequiredtocreateandupgradeaTwilioaccount,iftheyhaven’tdonesoalready. Donot Donotmakeauser’sAccountSIDavailabletoothers AlthoughallrequestsmadetotheTwilioAPImustbeauthenticatedwith yourownAuthToken,youshouldtreattheAccountSIDyoureceivefromTwilio asyouwouldotheruserdata. DonotchangeyourConnectApppermissionshaphazardly IfyouchangethepermissionsthatyourConnectApp requires,youwillnotbeabletousethemuntilyouruserreauthorizesyourConnectApp. ChangingyourConnectApppermissionsfrequentlymayleadtosituations whereyou’renotsurewhatpermissionsyouhaveforaparticularaccount.We recommendyouchangepermissionsonlywhenanewfeaturerequiresit. Permissions TherearetwopermissionsavailableforTwilioConnectApps: Readallaccountdata ThisallowsyourConnectApptoseealltheuser’sdata,includingcalls,SMS,recordings,andtranscriptions.YourConnectAppwillalsohaveaccesstoTwiliodatageneratedbyotherConnectApps,anysubaccount,andtheparentaccount.AConnectAppwiththispermissionalonewillonlybeabletoperformGETrequestsontheuser'saccounts. Chargeaccountforusage ThisallowsyourConnectApptoperformactionsthatchargeyouruser’sTwilioaccountsuchasmakeandreceivephonecalls,sendandreceiveSMSmessages,andbuyphonenumbers.YourConnectAppwillnothaveaccesstoresourcesintheuser’sparentaccount,likephonenumbers.Instead,yourConnectAppmustbuyphonenumbersonbehalfoftheuser,usingtheAccountSIDpassedtoyourAuthorizeURL. TheAccountSIDthatTwilioreturnstoyourAuthorizeURL—asthevalueofAccountSid—isasubaccountjustforyourapplicationwithintheuser'saccount.ThisallowsyourConnectApptobuynumbersandmakecallswithoutotherConnectAppsmodifyingyourdata. ConnectAppconfigurationoptions ConnectAppshaveavarietyofconfigurationoptionsthatTwiliousesindifferentpartsoftheauthorizationflowandtheaccountportal. Option Description FriendlyName ThenameofyourConnectApp.Itwillbedisplayedontheauthorizationscreenandtheuser’slistofauthorizedapps.Required ApplicationLogo AlogoorpictureassociatedwithyourConnectApp.Itwillbedisplayedontheauthorizationscreenandintheuser’slistofauthorizedapps.Required CompanyName ThenameoftheConnectApp’sdeveloper,ie.,yourcompany.Displayedontheauthorizationscreenandtheuser'slistofauthorizedapps.Required Description AbriefdescriptionofwhatyourConnectAppdoes.Displayedontheauthorizationscreen HomepageURL ThehomepageofyourConnectApp,displayedintheuser’slistofauthorizedapps TermsofServiceURL TheURLwhereuserscanreadyourConnectApp’sTermsofService.Itwillbedisplayedintheuser’slistofauthorizedapps AuthorizeURL TheURLtowhichtheuserwillberedirectedaftertheygothroughtheauthorizationflow.IftheuserapprovesaccessforyourConnectApp,theywillberedirectedtothisURLwiththeirAccountSIDasanHTTPGETquerystringparameternamedAccountSid.IfauserchoosestodeclineauthorizationtheywillberedirectedtothisURLwithasingleparameter:error=unauthorized_client DeauthorizeURL TheURLtowhichTwiliomakesarequestwhenauserrevokesaccesstoyourConnectApp.Thisisaserver-to-serverrequest;youruserswillneverbedirectedtothislocation.Twoparameterswillbesentaspartofthisrequest:AccountSidistheAccountSIDoftheuserwhohasdeauthorizedyourConnectApp.ConnectAppSidistheSIDoftheConnectAppthathasbeendeauthorized. DeauthorizeURLHTTPMethod TheHTTPmethodusedwhenmakingarequesttoyourDeauthorizeURL.YoucanselecteitherGETorPOST AccessRequired ThisdefinesthetypesofAPIaccessyourConnectAppwillrequire.Readthepermissionssectionformoredetails. Ratethispage: Needsomehelp? Wealldosometimes;codeishard.Gethelpnowfromoursupportteam,orleanonthewisdomofthecrowdbyvisitingTwilio'sStackOverflowCollectiveorbrowsingtheTwiliotagonStackOverflow. Thankyouforyourfeedback! Pleaseselectthereason(s)foryourfeedback.Theadditionalinformationyouprovidehelpsusimproveourdocumentation: IfapplicablefillinthecountrieswhereyouareusingTwilio Missinginformationorcode Contentisconfusingorhardtofollow Inaccurateoroutdatedinformation Brokenlinkortypo Didnotsolvemyproblem Contentiseasytofollow Solvedmyproblem Other Sendyoursuggestions Needhelp?TalktoSupport ProtectedbyreCAPTCHA–Privacy-Terms Sendingyourfeedback... 🎉Thankyouforyourfeedback! Somethingwentwrong.Pleasetryagain. Thanksforyourfeedback! Referusandget$10in3simplesteps! Step1 Getlink Getafreepersonalreferrallinkhere Step2 Give$10 Yourusersignsupandupgradeusinglink Step3 Get$10 1,250freeSMSesOR1,000freevoiceminsOR12,000chatsORmore Learnmoreaboutthereferralprogram



請為這篇文章評分?