Create external campaign

POST /v1/Services/PreregisteredUsa2p

Resource to associate preregistered campaign with Messaging Service.

application/x-www-form-urlencoded

Body

  • CampaignId string Required

    ID of the preregistered campaign.

  • MessagingServiceSid string Required

    The SID of the Messaging Service that the resource is associated with.

    Minimum length is 34, maximum length is 34. Format should match the following pattern: ^MG[0-9a-fA-F]{32}$.

  • CnpMigration boolean

    Customers should use this flag during the ERC registration process to indicate to Twilio that the campaign being registered is undergoing CNP migration. It is important for the user to first trigger the CNP migration process for said campaign in their CSP portal and have Twilio accept the sharing request, before making this api call.

Responses

  • 201 application/json

    Created

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • sid string | null

      The unique string that identifies a US A2P Compliance resource QE2c6890da8086d771620e9b13fadeba0b.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^QE[0-9a-fA-F]{32}$.

    • account_sid string | null

      The SID of the Account that the Campaign belongs to.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

    • campaign_id string | null

      ID of the preregistered campaign.

    • messaging_service_sid string | null

      The SID of the Messaging Service that the resource is associated with.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^MG[0-9a-fA-F]{32}$.

    • date_created string(date-time) | null

      The date and time in GMT when the resource was created specified in ISO 8601 format.

POST /v1/Services/PreregisteredUsa2p
curl \
 --request POST 'https://messaging.twilio.com/v1/Services/PreregisteredUsa2p' \
 --user "username:password" \
 --header "Content-Type: application/x-www-form-urlencoded" \
 --data 'CampaignId=CMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&CnpMigration=false&MessagingServiceSid=MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
Request example
{"CampaignId"=>"CMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "CnpMigration"=>false, "MessagingServiceSid"=>"MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}
Response examples (201)
{
  "sid": "QE2c6890da8086d771620e9b13fadeba0b",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "campaign_id": "CMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "date_created": "2021-03-21T21:31:00Z",
  "messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}