MyApp

<back to all web services

CreatePlayer

Game
package dtos

type PhoneKind string

const (
	PhoneKindHome   PhoneKind = "Home"
	PhoneKindMobile           = "Mobile"
	PhoneKindWork             = "Work"
)

type Phone struct {
	Kind   PhoneKind `json:"kind,omitempty"`
	Number string    `json:"number"`
	Ext    string    `json:"ext"`
}

type CreatePlayer struct {
	// @Validate(Validator="NotEmpty")
	FirstName    string  `json:"firstName"`
	LastName     *string `json:"lastName,omitempty"`
	Email        *string `json:"email,omitempty"`
	PhoneNumbers []Phone `json:"phoneNumbers,omitempty"`
	// @Validate(Validator="NotNull")
	ProfileId    *int    `json:"profileId"`
	SavedLevelId *string `json:"savedLevelId,omitempty"`
}

Go CreatePlayer DTOs

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

HTTP + OTHER

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

POST /jsonl/reply/CreatePlayer HTTP/1.1 
Host: blazor-gallery.servicestack.net 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"firstName":"String","lastName":"String","email":"String","phoneNumbers":[{"kind":"Home","number":"String","ext":"String"}],"profileId":0,"savedLevelId":"00000000-0000-0000-0000-000000000000"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"id":"String","responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}