Search code examples
c#twiliotwilio-api

Twilio Trust Hub Integration


I am integrating Trust Hub into our ISV software application. The purpose is A2P messaging. In order to do so we are following Twilio documentation. So there are a series of steps that we need to follow in order to create and register secondary customer profiles on Twilio and we have already a primary customer profile registered on Twilio. Right now we are stuck i.e. to create a secondary customer profile through C# code. There is a bit named as policySid, currently, we don't have this and don't know where to copy from. Although we have accountSid and authToken.

Here is the piece of code that we are trying with:

string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

TwilioClient.Init(accountSid, authToken);

var customerProfiles = CustomerProfilesResource.Create(
            statusCallback: new Uri("https://twilio.status.callback.com/url-provided-in-step-1.2"),
            friendlyName: "acme-inc",
            email: "acme-inc@acme.com",
            policySid: "RNdfbf3fae0e1107f8aded0e7cead80bf5"
        );

From where we can get this policySid token in order to create secondary customer profiles on Twilio for our ISV appcation?


Solution

  • You have the correct SID - it is hard coded. This page explains "Step 1.1 Fetch the Secondary Customer Profile Policy":

    1.1 Fetch the Secondary Customer Profile Policy

    This step requires you to use a hard-coded PolicySID: RNdfbf3fae0e1107f8aded0e7cead80bf5. As the Trust Hub is built to support multiple use cases, the PolicySID is the object that Twilio uses to store the various policies and regulations for that specific trust product. You will see this reappear later on for A2P 10DLC regulations.