Platform API

<back to all web services

GetStates

Get states for the specified country

The following routes are available for this service:
All Verbs/api/states/{CountryId}
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Eros.Subtle.Canvara.WebAPIModel.ServiceModel
Imports Eros.Saguna.Common.WebAPIModel.Models

Namespace Global

    Namespace Eros.Saguna.Common.WebAPIModel.Models

        Public Partial Class StateModel
            Public Overridable Property StateId As Guid
            Public Overridable Property Name As String
            Public Overridable Property ShortName As String
        End Class
    End Namespace

    Namespace Eros.Subtle.Canvara.WebAPIModel.ServiceModel

        '''<Summary>
        '''Get states for the specified country
        '''</Summary>
        <Api(Description:="Get states for the specified country")>
        Public Partial Class GetStates
            '''<Summary>
            '''Get states for the specified country id
            '''</Summary>
            <ApiMember(Description:="Get states for the specified country id", Name:="CountryId")>
            Public Overridable Property CountryId As Guid
        End Class

        <ApiResponse(Description:="List of states")>
        Public Partial Class GetStatesResponse
            Public Overridable Property States As List(Of StateModel)
            Public Overridable Property ResponseStatus As ResponseStatus
        End Class
    End Namespace
End Namespace

VB.NET GetStates 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 /api/states/{CountryId} HTTP/1.1 
Host: pfapi.pstpf.com.au 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"CountryId":"00000000-0000-0000-0000-000000000000"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"States":[{"StateId":"00000000-0000-0000-0000-000000000000","Name":"String","ShortName":"String"}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}