Method: countryCodes.smsOrigins.create

Maps recipient country code and sender ID to hash values of an SMS message and message segments.

HTTP request

POST https://verifiedsms.googleapis.com/v1/{parent=countryCodes/*/smsOrigins/*}

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

"countryCodes/{countryCode}/smsOrigins/{smsOrigin}" where {countryCode} is a ISO 3166 Alpha-2 country code of the recipient and {smsOrigin} is the URL-encoded phone number that will send the SMS message. This can be a long code (E.164 format), a short code, a national code, or an alphanumeric code.

For example, if the recipient's country code is US and the sender's phone number in E.164 format is +12223334444, the value is "countryCodes/US/smsOrigins/+12223334444", and the resulting endpoint is https://verifiedsms.googleapis.com/v1/countryCodes/US/smsOrigins/%2B12223334444.

If the recipient's country code is US and the sender's phone number in the USA national format is (222) 333-4444, the value is "countryCodes/US/smsOrigins/(222)%20333-4444", and the resulting endpoint is https://verifiedsms.googleapis.com/v1/countryCodes/US/smsOrigins/(222)%20333-4444.

If the recipient's country code is US and the sender's phone number in short format is 123456, the value is "countryCodes/US/smsOrigins/123456", and the resulting endpoint is https://verifiedsms.googleapis.com/v1/countryCodes/US/smsOrigins/123456.

If the recipient's country code is BR and the sender's phone number in alphanumeric format is CODÓCAFÉ, the value is "countryCodes/BR/smsOrigins/CODÓCAFÉ", and the resulting endpoint is https://verifiedsms.googleapis.com/v1/countryCodes/BR/smsOrigins/COD%C3%93CAF%C3%89.

Request body

The request body contains an instance of Sms.

Response body

If successful, the response body contains data with the following structure:

Information about an SMS message. Includes name, origin, and hash codes.

JSON representation
{
  "name": string,
  "hashCodes": [
    {
      object(SmsHashCode)
    }
  ]
}
Fields
name

string

This field is set by Verified SMS. Don't include it when you register a message. This field resolves to "countryCodes/{countryCode}/smsOrigins/{smsOrigin}", where {countryCode} is the country ISO-2 code of the recipient, and {smsOrigin} is your sender ID.

hashCodes[]

object(SmsHashCode)

SMS hash codes for all algorithms.

SmsHashCode

Hash codes for an SMS message and its segments.

JSON representation
{
  "fullMessageHashCode": string,
  "segmentsHashCodes": [
    string
  ],
  "hashCodeVersion": string
}
Fields
fullMessageHashCode

string (bytes format)

Hash code for a full SMS message.

A base64-encoded string.

segmentsHashCodes[]

string (bytes format)

Hash codes for SMS message segments. May be empty if the message is shorter than 140 bytes or if segments don't need verification (i.e. the carrier support SMS segments, and the client correctly assembles segmints as a single message).

A base64-encoded string.

hashCodeVersion

string

Algorithm version for SMS message hash code. For example, v0 or v1.