Trendsic Platform Service

<back to all web services

UserVerifyCellPhoneRequest

The following routes are available for this service:
GET,PUT,POST,OPTIONS/v1/userverifycellphone
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


class CoreChecksumAlgorithm(str, Enum):
    NONE = 'NONE'
    CR_C32_C = 'CRC32C'
    CR_C32 = 'CRC32'
    SH_A256 = 'SHA256'
    SH_A1 = 'SHA1'


class ChecksumValidationStatus(str, Enum):
    NO_T__V_A_L_I_D_A_T_E_D = 'NOT_VALIDATED'
    PENDIN_G__R_E_S_P_O_N_S_E__R_E_A_D = 'PENDING_RESPONSE_READ'
    SUCCESSFUL = 'SUCCESSFUL'
    INVALID = 'INVALID'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ResponseMetadata:
    request_id: Optional[str] = None
    metadata: Optional[Dict[str, str]] = None
    checksum_algorithm: Optional[CoreChecksumAlgorithm] = None
    checksum_validation_status: Optional[ChecksumValidationStatus] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AmazonWebServiceResponse:
    response_metadata: Optional[ResponseMetadata] = None
    content_length: int = 0
    http_status_code: Optional[HttpStatusCode] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class NewDeviceMetadataType:
    device_group_key: Optional[str] = None
    device_key: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AuthenticationResultType:
    access_token: Optional[str] = None
    expires_in: int = 0
    id_token: Optional[str] = None
    new_device_metadata: Optional[NewDeviceMetadataType] = None
    refresh_token: Optional[str] = None
    token_type: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ConstantClass:
    value: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ChallengeNameType(ConstantClass):
    pass


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class InitiateAuthResponse(AmazonWebServiceResponse):
    authentication_result: Optional[AuthenticationResultType] = None
    challenge_name: Optional[ChallengeNameType] = None
    challenge_parameters: Dict[str, str] = field(default_factory=dict)
    session: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AwsAuthResponse:
    response_status: Optional[ResponseStatus] = None
    initiate_auth_response: Optional[InitiateAuthResponse] = None
    success: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UserVerifyCellPhoneRequest:
    user_id: Optional[str] = None
    cell_phone: Optional[str] = None
    verification_code: Optional[str] = None

Python UserVerifyCellPhoneRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/userverifycellphone HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	UserId: 00000000000000000000000000000000,
	CellPhone: String,
	VerificationCode: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	},
	InitiateAuthResponse: 
	{
		AuthenticationResult: 
		{
			AccessToken: String,
			ExpiresIn: 0,
			IdToken: String,
			NewDeviceMetadata: 
			{
				DeviceGroupKey: String,
				DeviceKey: String
			},
			RefreshToken: String,
			TokenType: String
		},
		ChallengeParameters: 
		{
			String: String
		},
		Session: String,
		ResponseMetadata: 
		{
			RequestId: String,
			Metadata: {},
			ChecksumAlgorithm: NONE,
			ChecksumValidationStatus: NOT_VALIDATED
		},
		ContentLength: 0,
		HttpStatusCode: Continue
	},
	Success: False
}