| Requires any of the roles: | Agent, Administrator |
| GET | /v1/Survey/GiftCard/{UID} |
|---|
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
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SurveyQuestion:
question_id: int = 0
question_type: Optional[str] = None
html: Optional[str] = None
depends_on: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Survey:
survey_id: int = 0
contact_id: int = 0
questions: List[SurveyQuestion] = field(default_factory=list)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GiftCardSurvey(Survey):
gift_card_id: int = 0
gift_cards: List[str] = field(default_factory=list)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GiftCardSurveyResponse:
survey: Optional[GiftCardSurvey] = None
response_status: Optional[ResponseStatus] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GiftCardSurveyRequest:
uid: Optional[str] = None
Python GiftCardSurveyRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v1/Survey/GiftCard/{UID} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
Survey:
{
GiftCardId: 0,
GiftCards:
[
String
],
SurveyId: 0,
ContactId: 0,
Questions:
[
{
QuestionId: 0,
QuestionType: String,
HTML: String,
DependsOn: String
}
]
},
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
}
}