DRC API LIBRARY

DRC’s solutions include a number of application programming interfaces (API) that are available right out of the box. 

 

DRC’s API Library includes RESTful services for:

GET v1/users/GetCurrentUserId

Get current user id

Request Information
URI Parameters

None.

Body Parameters

None.

Response Information
Resource Description

userDto

Name Description Type Additional information
userID integer None.
userName string None.
password string None.
agentID integer None.
Response Formats
application/json, text/json
Sample:
{
  "userID": 1,
  "userName": "sample string 2",
  "password": "sample string 3",
  "agentID": 4
}
application/xml, text/xml
Sample:
<userDto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/GCApi.Models">
  <agentID>4</agentID>
  <password>sample string 3</password>
  <userID>1</userID>
  <userName>sample string 2</userName>
</userDto>

POST v1/users/{id}

Update User

Request Information
URI Parameters
Name Description Type Additional information
id integer Required
Body Parameters

userDto

Name Description Type Additional information
userID integer None.
userName string None.
password string None.
agentID integer None.
Request Formats
application/json, text/json
Sample:
application/xml, text/xml
Sample:
{
  "userID": 1,
  "userName": "sample string 2",
  "password": "sample string 3",
  "agentID": 4
}
application/xml, text/xml
Sample:
<userDto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/GCApi.Models">
  <agentID>4</agentID>
  <password>sample string 3</password>
  <userID>1</userID>
  <userName>sample string 2</userName>
</userDto>
application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type ‘application/x-www-form-urlencoded’. Cannot use formatter ‘JQueryMvcFormUrlEncodedFormatter’ to write type ‘userDto’.

Response Information
Resource Description

userDto

Name Description Type Additional information
userID integer None.
userName string None.
password string None.
agentID integer None.
Response Formats
application/json, text/json
Sample:
{
  "userID": 1,
  "userName": "sample string 2",
  "password": "sample string 3",
  "agentID": 4
}
application/xml, text/xml
Sample:
<userDto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/GCApi.Models">
  <agentID>4</agentID>
  <password>sample string 3</password>
  <userID>1</userID>
  <userName>sample string 2</userName>
</userDto>

GET v1/customers

List first 20 customers sorted by Id in descending order

Request Information
URI Parameters

None.

Body Parameters

None.

Response Information
Resource Description

List of customers

customerListDto

Name Description Type Additional information
totalCount integer None.
hasMore boolean None.
data Collection of customerDto None.
Response Formats
application/json, text/json
Sample:
{
  "totalCount": 1,
  "hasMore": true,
  "data": [
    {
      "FirstName": "sample string 1",
      "LastName": "sample string 2",
      "CommercialName": "sample string 3",
      "Type": "Unknown",
      "RiskAddress": {
        "Id": 1,
        "Address1": "sample string 2",
        "Address2": "sample string 3",
        "City": "sample string 4",
        "State": "sample string 5",
        "Zipcode1": "sample string 6",
        "Zipcode2": "sample string 7"
      },
      "MailingAddress": {
        "Id": 1,
        "Address1": "sample string 2",
        "Address2": "sample string 3",
        "City": "sample string 4",
        "State": "sample string 5",
        "Zipcode1": "sample string 6",
        "Zipcode2": "sample string 7"
      },
      "PrimaryMobilePhone": "sample string 4",
      "HomePhone": "sample string 5",
      "quotes": {
        "totalCount": 1,
        "hasMore": true,
        "data": [
          {
            "quoteNumber": "sample string 1",
            "id": 2,
            "objectType": "sample string 3"
          },
          {
            "quoteNumber": "sample string 1",
            "id": 2,
            "objectType": "sample string 3"
          }
        ]
      },
      "id": 6,
      "objectType": "sample string 7"
    },
    {
      "FirstName": "sample string 1",
      "LastName": "sample string 2",
      "CommercialName": "sample string 3",
      "Type": "Unknown",
      "RiskAddress": {
        "Id": 1,
        "Address1": "sample string 2",
        "Address2": "sample string 3",
        "City": "sample string 4",
        "State": "sample string 5",
        "Zipcode1": "sample string 6",
        "Zipcode2": "sample string 7"
      },
      "MailingAddress": {
        "Id": 1,
        "Address1": "sample string 2",
        "Address2": "sample string 3",
        "City": "sample string 4",
        "State": "sample string 5",
        "Zipcode1": "sample string 6",
        "Zipcode2": "sample string 7"
      },
      "PrimaryMobilePhone": "sample string 4",
      "HomePhone": "sample string 5",
      "quotes": {
        "totalCount": 1,
        "hasMore": true,
        "data": [
          {
            "quoteNumber": "sample string 1",
            "id": 2,
            "objectType": "sample string 3"
          },
          {
            "quoteNumber": "sample string 1",
            "id": 2,
            "objectType": "sample string 3"
          }
        ]
      },
      "id": 6,
      "objectType": "sample string 7"
    }
  ]
}
application/xml, text/xml
Sample:
<customerListDto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/GCApi.Models">
  <data>
    <customerDto>
      <id>6</id>
      <objectType>sample string 7</objectType>
      <CommercialName>sample string 3</CommercialName>
      <FirstName>sample string 1</FirstName>
      <HomePhone>sample string 5</HomePhone>
      <LastName>sample string 2</LastName>
      <MailingAddress>
        <Address1>sample string 2</Address1>
        <Address2>sample string 3</Address2>
        <City>sample string 4</City>
        <Id>1</Id>
        <State>sample string 5</State>
        <Zipcode1>sample string 6</Zipcode1>
        <Zipcode2>sample string 7</Zipcode2>
      </MailingAddress>
      <PrimaryMobilePhone>sample string 4</PrimaryMobilePhone>
      <RiskAddress>
        <Address1>sample string 2</Address1>
        <Address2>sample string 3</Address2>
        <City>sample string 4</City>
        <Id>1</Id>
        <State>sample string 5</State>
        <Zipcode1>sample string 6</Zipcode1>
        <Zipcode2>sample string 7</Zipcode2>
      </RiskAddress>
      <Type>Unknown</Type>
      <quotes>
        <data>
          <quoteDto>
            <id>2</id>
            <objectType>sample string 3</objectType>
            <quoteNumber>sample string 1</quoteNumber>
          </quoteDto>
          <quoteDto>
            <id>2</id>
            <objectType>sample string 3</objectType>
            <quoteNumber>sample string 1</quoteNumber>
          </quoteDto>
        </data>
        <hasMore>true</hasMore>
        <totalCount>1</totalCount>
      </quotes>
    </customerDto>
    <customerDto>
      <id>6</id>
      <objectType>sample string 7</objectType>
      <CommercialName>sample string 3</CommercialName>
      <FirstName>sample string 1</FirstName>
      <HomePhone>sample string 5</HomePhone>
      <LastName>sample string 2</LastName>
      <MailingAddress>
        <Address1>sample string 2</Address1>
        <Address2>sample string 3</Address2>
        <City>sample string 4</City>
        <Id>1</Id>
        <State>sample string 5</State>
        <Zipcode1>sample string 6</Zipcode1>
        <Zipcode2>sample string 7</Zipcode2>
      </MailingAddress>
      <PrimaryMobilePhone>sample string 4</PrimaryMobilePhone>
      <RiskAddress>
        <Address1>sample string 2</Address1>
        <Address2>sample string 3</Address2>
        <City>sample string 4</City>
        <Id>1</Id>
        <State>sample string 5</State>
        <Zipcode1>sample string 6</Zipcode1>
        <Zipcode2>sample string 7</Zipcode2>
      </RiskAddress>
      <Type>Unknown</Type>
      <quotes>
        <data>
          <quoteDto>
            <id>2</id>
            <objectType>sample string 3</objectType>
            <quoteNumber>sample string 1</quoteNumber>
          </quoteDto>
          <quoteDto>
            <id>2</id>
            <objectType>sample string 3</objectType>
            <quoteNumber>sample string 1</quoteNumber>
          </quoteDto>
        </data>
        <hasMore>true</hasMore>
        <totalCount>1</totalCount>
      </quotes>
    </customerDto>
  </data>
  <hasMore>true</hasMore>
  <totalCount>1</totalCount>
</customerListDto>

GET v1/customers/{id}

Get Customer details

Request Information
URI Parameters
Name Description Type Additional information
id id of customer to load integer Required
Body Parameters

None.

Response Information
Resource Description

Customer details

customerDto

Name Description Type Additional information
FirstName string None.
LastName string None.
CommercialName string None.
Type customerTypeEnum None.
RiskAddress addressDto None.
MailingAddress addressDto None.
PrimaryMobilePhone string None.
HomePhone string None.
quotes quoteListDto None.
id integer None.
objectType string None.
Response Formats
application/json, text/json
Sample:
{
  "FirstName": "sample string 1",
  "LastName": "sample string 2",
  "CommercialName": "sample string 3",
  "Type": "Unknown",
  "RiskAddress": {
    "Id": 1,
    "Address1": "sample string 2",
    "Address2": "sample string 3",
    "City": "sample string 4",
    "State": "sample string 5",
    "Zipcode1": "sample string 6",
    "Zipcode2": "sample string 7"
  },
  "MailingAddress": {
    "Id": 1,
    "Address1": "sample string 2",
    "Address2": "sample string 3",
    "City": "sample string 4",
    "State": "sample string 5",
    "Zipcode1": "sample string 6",
    "Zipcode2": "sample string 7"
  },
  "PrimaryMobilePhone": "sample string 4",
  "HomePhone": "sample string 5",
  "quotes": {
    "totalCount": 1,
    "hasMore": true,
    "data": [
      {
        "quoteNumber": "sample string 1",
        "id": 2,
        "objectType": "sample string 3"
      },
      {
        "quoteNumber": "sample string 1",
        "id": 2,
        "objectType": "sample string 3"
      }
    ]
  },
  "id": 6,
  "objectType": "sample string 7"
}
application/xml, text/xml
Sample:
<customerDto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/GCApi.Models">
  <id>6</id>
  <objectType>sample string 7</objectType>
  <CommercialName>sample string 3</CommercialName>
  <FirstName>sample string 1</FirstName>
  <HomePhone>sample string 5</HomePhone>
  <LastName>sample string 2</LastName>
  <MailingAddress>
    <Address1>sample string 2</Address1>
    <Address2>sample string 3</Address2>
    <City>sample string 4</City>
    <Id>1</Id>
    <State>sample string 5</State>
    <Zipcode1>sample string 6</Zipcode1>
    <Zipcode2>sample string 7</Zipcode2>
  </MailingAddress>
  <PrimaryMobilePhone>sample string 4</PrimaryMobilePhone>
  <RiskAddress>
    <Address1>sample string 2</Address1>
    <Address2>sample string 3</Address2>
    <City>sample string 4</City>
    <Id>1</Id>
    <State>sample string 5</State>
    <Zipcode1>sample string 6</Zipcode1>
    <Zipcode2>sample string 7</Zipcode2>
  </RiskAddress>
  <Type>Unknown</Type>
  <quotes>
    <data>
      <quoteDto>
        <id>2</id>
        <objectType>sample string 3</objectType>
        <quoteNumber>sample string 1</quoteNumber>
      </quoteDto>
      <quoteDto>
        <id>2</id>
        <objectType>sample string 3</objectType>
        <quoteNumber>sample string 1</quoteNumber>
      </quoteDto>
    </data>
    <hasMore>true</hasMore>
    <totalCount>1</totalCount>
  </quotes>
</customerDto>

POST v1/customers

Create Customer

Request Information
URI Parameters

None.

Body Parameters

customerDto

Name Description Type Additional information
FirstName string None.
LastName string None.
CommercialName string None.
Type customerTypeEnum None.
RiskAddress addressDto None.
MailingAddress addressDto None.
PrimaryMobilePhone string None.
HomePhone string None.
quotes quoteListDto None.
id integer None.
objectType string None.
Request Formats
application/json, text/json

Sample:

 

<customerDto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/GCApi.Models">
  <id>6</id>
  <objectType>sample string 7</objectType>
  <CommercialName>sample string 3</CommercialName>
  <FirstName>sample string 1</FirstName>
  <HomePhone>sample string 5</HomePhone>
  <LastName>sample string 2</LastName>
  <MailingAddress>
    <Address1>sample string 2</Address1>
    <Address2>sample string 3</Address2>
    <City>sample string 4</City>
    <Id>1</Id>
    <State>sample string 5</State>
    <Zipcode1>sample string 6</Zipcode1>
    <Zipcode2>sample string 7</Zipcode2>
  </MailingAddress>
  <PrimaryMobilePhone>sample string 4</PrimaryMobilePhone>
  <RiskAddress>
    <Address1>sample string 2</Address1>
    <Address2>sample string 3</Address2>
    <City>sample string 4</City>
    <Id>1</Id>
    <State>sample string 5</State>
    <Zipcode1>sample string 6</Zipcode1>
    <Zipcode2>sample string 7</Zipcode2>
  </RiskAddress>
  <Type>Unknown</Type>
  <quotes>
    <data>
      <quoteDto>
        <id>2</id>
        <objectType>sample string 3</objectType>
        <quoteNumber>sample string 1</quoteNumber>
      </quoteDto>
      <quoteDto>
        <id>2</id>
        <objectType>sample string 3</objectType>
        <quoteNumber>sample string 1</quoteNumber>
      </quoteDto>
    </data>
    <hasMore>true</hasMore>
    <totalCount>1</totalCount>
  </quotes>
</customerDto>

application/xml, text/xml

Sample:
<customerDto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/GCApi.Models">
  <id>6</id>
  <objectType>sample string 7</objectType>
  <CommercialName>sample string 3</CommercialName>
  <FirstName>sample string 1</FirstName>
  <HomePhone>sample string 5</HomePhone>
  <LastName>sample string 2</LastName>
  <MailingAddress>
    <Address1>sample string 2</Address1>
    <Address2>sample string 3</Address2>
    <City>sample string 4</City>
    <Id>1</Id>
    <State>sample string 5</State>
    <Zipcode1>sample string 6</Zipcode1>
    <Zipcode2>sample string 7</Zipcode2>
  </MailingAddress>
  <PrimaryMobilePhone>sample string 4</PrimaryMobilePhone>
  <RiskAddress>
    <Address1>sample string 2</Address1>
    <Address2>sample string 3</Address2>
    <City>sample string 4</City>
    <Id>1</Id>
    <State>sample string 5</State>
    <Zipcode1>sample string 6</Zipcode1>
    <Zipcode2>sample string 7</Zipcode2>
  </RiskAddress>
  <Type>Unknown</Type>
  <quotes>
    <data>
      <quoteDto>
        <id>2</id>
        <objectType>sample string 3</objectType>
        <quoteNumber>sample string 1</quoteNumber>
      </quoteDto>
      <quoteDto>
        <id>2</id>
        <objectType>sample string 3</objectType>
        <quoteNumber>sample string 1</quoteNumber>
      </quoteDto>
    </data>
    <hasMore>true</hasMore>
    <totalCount>1</totalCount>
  </quotes>
</customerDto>
application/x-www-form-urlencoded

Sample: Failed to generate the sample for media type ‘application/x-www-form-urlencoded’. Cannot use formatter ‘JQueryMvcFormUrlEncodedFormatter’ to write type ‘customerDto’.

Response Information
Resource Description

Id (integer) of newly created customer, with Http Status Code 201 when created, 404 if not found or 400/500 with error details

integer

Response Formats

application/json, text/json

Sample:

1
application/xml, text/xml
Sample:
<int xmlns="http://schemas.microsoft.com/2003/10/Serialization/">1</int>

.

PUT v1/customers/{id}

Update Customer

Request Information
URI Parameters
Name Description Type Additional information
id Id of customer to Update integer Required
Body Parameters

customerDto

Name Description Type Additional information
FirstName string None.
LastName string None.
CommercialName string None.
Type CustomerTypeEnum None.
RiskAddress addressDto None.
MailingAddress addressDto None.
PrimaryMobilePhone string None.
HomePhone string None.
quotes quoteListDto None.
id integer None.
objectType string None.
Request Formats
application/json, text/json
Sample:
{
  "FirstName": "sample string 1",
  "LastName": "sample string 2",
  "CommercialName": "sample string 3",
  "Type": "Unknown",
  "RiskAddress": {
    "Id": 1,
    "Address1": "sample string 2",
    "Address2": "sample string 3",
    "City": "sample string 4",
    "State": "sample string 5",
    "Zipcode1": "sample string 6",
    "Zipcode2": "sample string 7"
  },
  "MailingAddress": {
    "Id": 1,
    "Address1": "sample string 2",
    "Address2": "sample string 3",
    "City": "sample string 4",
    "State": "sample string 5",
    "Zipcode1": "sample string 6",
    "Zipcode2": "sample string 7"
  },
  "PrimaryMobilePhone": "sample string 4",
  "HomePhone": "sample string 5",
  "quotes": {
    "totalCount": 1,
    "hasMore": true,
    "data": [
      {
        "quoteNumber": "sample string 1",
        "id": 2,
        "objectType": "sample string 3"
      },
      {
        "quoteNumber": "sample string 1",
        "id": 2,
        "objectType": "sample string 3"
      }
    ]
  },
  "id": 6,
  "objectType": "sample string 7"
}

application/xml, text/xml

Sample:
<customerDto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/GCApi.Models">
  <id>6</id>
  <objectType>sample string 7</objectType>
  <CommercialName>sample string 3</CommercialName>
  <FirstName>sample string 1</FirstName>
  <HomePhone>sample string 5</HomePhone>
  <LastName>sample string 2</LastName>
  <MailingAddress>
    <Address1>sample string 2</Address1>
    <Address2>sample string 3</Address2>
    <City>sample string 4</City>
    <Id>1</Id>
    <State>sample string 5</State>
    <Zipcode1>sample string 6</Zipcode1>
    <Zipcode2>sample string 7</Zipcode2>
  </MailingAddress>
  <PrimaryMobilePhone>sample string 4</PrimaryMobilePhone>
  <RiskAddress>
    <Address1>sample string 2</Address1>
    <Address2>sample string 3</Address2>
    <City>sample string 4</City>
    <Id>1</Id>
    <State>sample string 5</State>
    <Zipcode1>sample string 6</Zipcode1>
    <Zipcode2>sample string 7</Zipcode2>
  </RiskAddress>
  <Type>Unknown</Type>
  <quotes>
    <data>
      <quoteDto>
        <id>2</id>
        <objectType>sample string 3</objectType>
        <quoteNumber>sample string 1</quoteNumber>
      </quoteDto>
      <quoteDto>
        <id>2</id>
        <objectType>sample string 3</objectType>
        <quoteNumber>sample string 1</quoteNumber>
      </quoteDto>
    </data>
    <hasMore>true</hasMore>
    <totalCount>1</totalCount>
  </quotes>
</customerDto>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type ‘application/x-www-form-urlencoded’. Cannot use formatter ‘JQueryMvcFormUrlEncodedFormatter’ to write type ‘customerDto’.

Response Information

Resource Description

Http Status Code 200 when success, 404 if not found or 500 with error details

HttpResponseMessage

Name Description Type Additional information
Version Version None.
Content HttpContent None.
StatusCode HttpStatusCode None.
ReasonPhrase string None.
Headers Collection of Object None.
RequestMessage HttpRequestMessage None.
IsSuccessStatusCode boolean None.

GET v1/customers/{customerId}/quotes

Request Information
URI Parameters
Name Description Type Additional information
customerId integer Required
Body Parameters

None.

Response Information

Resource Description

Collection of quoteDto

Name Description Type Additional information
quoteNumber string None.
id integer None.
objectType string None.
Response Formats
application/json, text/json
Sample:
[
  {
    "quoteNumber": "sample string 1",
    "id": 2,
    "objectType": "sample string 3"
  },
  {
    "quoteNumber": "sample string 1",
    "id": 2,
    "objectType": "sample string 3"
  }
]

application/xml, text/xml

Sample:
<ArrayOfquoteDto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/GCApi.Models">
  <quoteDto>
    <id>2</id>
    <objectType>sample string 3</objectType>
    <quoteNumber>sample string 1</quoteNumber>
  </quoteDto>
  <quoteDto>
    <id>2</id>
    <objectType>sample string 3</objectType>
    <quoteNumber>sample string 1</quoteNumber>
  </quoteDto>
</ArrayOfquoteDto>

GET v1/agents/{id}

Get Agent details

Request Information

URI Parameters
Name Description Type Additional information
id integer Required
Body Parameters

None.

Response Information
Resource Description

agentDto

Name Description Type Additional information
Id integer None.
FirstName string None.
LastName string None.
CommercialName string None.
UserName string None.
Email string None.
Role string None.
ParentAgentId integer None.
IsActive boolean None.
Commissions Collection of commissionDto None.
ParentAgent agentDto None.
Response Formats
application/json, text/json
Sample:
{
  "Id": 1,
  "FirstName": "sample string 2",
  "LastName": "sample string 3",
  "CommercialName": "sample string 4",
  "UserName": "sample string 5",
  "Email": "sample string 6",
  "Role": "sample string 7",
  "ParentAgentId": 1,
  "IsActive": true,
  "Commissions": [
    {
      "rate": 1.0,
      "lob": "sample string 1",
      "state": "sample string 2",
      "commissionOverride": "sample string 3",
      "id": 4,
      "objectType": "sample string 5"
    },
    {
      "rate": 1.0,
      "lob": "sample string 1",
      "state": "sample string 2",
      "commissionOverride": "sample string 3",
      "id": 4,
      "objectType": "sample string 5"
    }
  ]
}
application/xml

Sample:

An exception has occurred while using the formatter ‘XmlMediaTypeFormatter’ to generate sample for media type ‘application/xml’. Exception message: Object graph for type ‘GCApi.Models.agentDto’ contains cycles and cannot be serialized if reference tracking is disabled.

text/xml

Sample:

An exception has occurred while using the formatter ‘XmlMediaTypeFormatter’ to generate sample for media type ‘text/xml’. Exception message: Object graph for type ‘GCApi.Models.agentDto’ contains cycles and cannot be serialized if reference tracking is disabled

POST v1/agents

Create Agent

Request Information
URI Parameters

None.

Body Parameters

agentDto

Name Description Type Additional information
Id integer None.
FirstName string None.
LastName string None.
CommercialName string None.
UserName string None.
Email string None.
Role string None.
ParentAgentId integer None.
IsActive boolean None.
Commissions Collection of commissionDto None.
ParentAgent agentDto None.
Request Formats
application/json, text/json
Sample:
application/xml, text/xml
Sample:
{
  "Id": 1,
  "FirstName": "sample string 2",
  "LastName": "sample string 3",
  "CommercialName": "sample string 4",
  "UserName": "sample string 5",
  "Email": "sample string 6",
  "Role": "sample string 7",
  "ParentAgentId": 1,
  "IsActive": true,
  "Commissions": [
    {
      "rate": 1.0,
      "lob": "sample string 1",
      "state": "sample string 2",
      "commissionOverride": "sample string 3",
      "id": 4,
      "objectType": "sample string 5"
    },
    {
      "rate": 1.0,
      "lob": "sample string 1",
      "state": "sample string 2",
      "commissionOverride": "sample string 3",
      "id": 4,
      "objectType": "sample string 5"
    }
  ]
}
application/xml

Sample:

An exception has occurred while using the formatter ‘XmlMediaTypeFormatter’ to generate sample for media type ‘application/xml’. Exception message: Object graph for type ‘GCApi.Models.agentDto’ contains cycles and cannot be serialized if reference tracking is disabled.

text/xml

Sample:

An exception has occurred while using the formatter ‘XmlMediaTypeFormatter’ to generate sample for media type ‘text/xml’. Exception message: Object graph for type ‘GCApi.Models.agentDto’ contains cycles and cannot be serialized if reference tracking is disabled.

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type ‘application/x-www-form-urlencoded’. Cannot use formatter ‘JQueryMvcFormUrlEncodedFormatter’ to write type ‘agentDto’.

Response Information
Resource Description
integer
Response Formats
application/json, text/json
Sample:

1

application/xml, text/xml
Sample:
<int xmlns="http://schemas.microsoft.com/2003/10/Serialization/">1</int>

PUT v1/agents/{id}

Update Agent

Request Information
URI Parameters
Name Description Type Additional information
id integer Required
Body Parameters

agentDto

Name Description Type Additional information
Id integer None.
FirstName string None.
LastName string None.
CommercialName string None.
UserName string None.
Email string None.
Role string None.
ParentAgentId integer None.
IsActive boolean None.
Commissions Collection of commissionDto None.
ParentAgent agentDto None.
Request Formats
application/json, text/json
Sample:
{
  "Id": 1,
  "FirstName": "sample string 2",
  "LastName": "sample string 3",
  "CommercialName": "sample string 4",
  "UserName": "sample string 5",
  "Email": "sample string 6",
  "Role": "sample string 7",
  "ParentAgentId": 1,
  "IsActive": true,
  "Commissions": [
    {
      "rate": 1.0,
      "lob": "sample string 1",
      "state": "sample string 2",
      "commissionOverride": "sample string 3",
      "id": 4,
      "objectType": "sample string 5"
    },
    {
      "rate": 1.0,
      "lob": "sample string 1",
      "state": "sample string 2",
      "commissionOverride": "sample string 3",
      "id": 4,
      "objectType": "sample string 5"
    }
  ]
}
application/xml

Sample:

An exception has occurred while using the formatter ‘XmlMediaTypeFormatter’ to generate sample for media type ‘application/xml’. Exception message: Object graph for type ‘GCApi.Models.agentDto’ contains cycles and cannot be serialized if reference tracking is disabled.

text/xml

Sample:

An exception has occurred while using the formatter ‘XmlMediaTypeFormatter’ to generate sample for media type ‘text/xml’. Exception message: Object graph for type ‘GCApi.Models.agentDto’ contains cycles and cannot be serialized if reference tracking is disabled.

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type ‘application/x-www-form-urlencoded’. Cannot use formatter ‘JQueryMvcFormUrlEncodedFormatter’ to write type ‘agentDto’.

Response Information
Resource Description

None.

POST v1/agents/deactivate?id={id}

Deactivate agent

Request Information
URI Parameters
Name Description Type Additional information
id integer Required
Body Parameters

None.

Response Information
Resource Description

HttpResponseMessage

Name Description Type Additional information
Version Version None.
Content HttpContent None.
StatusCode HttpStatusCode None.
ReasonPhrase string None.
Headers Collection of Object None.
RequestMessage HttpRequestMessage None.
IsSuccessStatusCode boolean None.

conventions

Rule Example
Use sub-resources for relations GET /customers/711/quotes/ Returns a list of quotes for customer 711
GET /customers/711/quotes/4 Returns quote #4 for customer 711
Use a unique query parameter for all fields or a query language for filtering GET /customers?lastname=smith Returns a list of customers with lastname ‘smith’
GET /customers?dateOfBirth<=1/1/1990 Returns a list of customers born before 1/1/1990
Allow ascending and descending sorting over multiple fields GET /customers?sort=-lastname,+firstname
This returns a list of customers sorted by descending lastname and ascending firstname.
Use limit and offset. It is flexible for the user and common in leading databases. The default should be limit=20 and offset=0 GET /customers?offset=10&limit=5
To send the total entries back to the user use the custom HTTP header: X-Total-Count
Query string flags can be used for resource expansion when you know in advance that you are going to need the extra information GET /customers/711?expand=quotes
Use HTTP status codes:
200 – OK – Eyerything is working
201 – OK – New resource has been created
204 – OK – The resource was successfully deleted
400 – Bad Request – The request was invalid or cannot be served. The exact error should be explained in the error payload. E.g. „The JSON is not valid“
401 – Unauthorized – The request requires an user authentication
403 – Forbidden – The server understood the request, but is refusing it or the access is not allowed.
404 – Not found – There is no resource behind the URI.
500 – Internal Server Error – API developers should avoid this error. If an error occurs in the global catch blog, the stracktrace should be logged and not returned as response.