Northwind Web Services

<back to all web services

GetAllCustomers

Customers
The following routes are available for this service:
All Verbs/customers
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Northwind.ServiceModel
Imports Northwind.ServiceModel.Types

Namespace Global

    Namespace Northwind.ServiceModel

        <DataContract>
        Public Partial Class CustomersResponse
            Public Sub New()
                Results = New List(Of Customer)
            End Sub

            <DataMember>
            Public Overridable Property Results As List(Of Customer)

            <DataMember>
            Public Overridable Property ResponseStatus As ResponseStatus
        End Class

        Public Partial Class GetAllCustomers
            Implements IGet
        End Class
    End Namespace

    Namespace Northwind.ServiceModel.Types

        <DataContract>
        Public Partial Class Customer
            <DataMember>
            Public Overridable Property Id As String

            <DataMember>
            Public Overridable Property CompanyName As String

            <DataMember>
            Public Overridable Property ContactName As String

            <DataMember>
            Public Overridable Property ContactTitle As String

            <DataMember>
            Public Overridable Property Address As String

            <DataMember>
            Public Overridable Property City As String

            <DataMember>
            Public Overridable Property Region As String

            <DataMember>
            Public Overridable Property PostalCode As String

            <DataMember>
            Public Overridable Property Country As String

            <DataMember>
            Public Overridable Property Phone As String

            <DataMember>
            Public Overridable Property Fax As String
        End Class
    End Namespace
End Namespace

VB.NET GetAllCustomers DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

POST /customers HTTP/1.1 
Host: northwind.netcore.io 
Accept: application/json
Content-Type: application/json
Content-Length: length

{}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"results":[{"id":"String","companyName":"String","contactName":"String","contactTitle":"String","address":"String","city":"String","region":"String","postalCode":"String","country":"String","phone":"String","fax":"String"}],"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}