1Fetch Client API

<back to all web services

AddSubscription

The following routes are available for this service:
POST/subscription/{EventType}Subscribe to an event with a url we should post to
POST/subscriptionSubscribe to an event with a url we should post to
AddSubscription Parameters:
NameParameterData TypeRequiredDescription
EventTypepathWebhookSubscriptionEventTypeYesThe event type being subscribed to

Allowable Values

  • DriverOnTheWay
  • ArrivedAtWaypoint
  • DepartedWaypoint
  • OrderCompleted
  • OrderCancelled
SubscriptionUrlbodystringYesThe URL we should post the event data to
ApiServiceRequest Parameters:
NameParameterData TypeRequiredDescription
ApiKeyformstringYesThe API Key required for authentication
WebhookSubscriptionEventType Enum:
NameValue
DriverOnTheWay0
ArrivedAtWaypoint1
DepartedWaypoint2
OrderCompleted3
OrderCancelled4
ApiServiceResponse Parameters:
NameParameterData TypeRequiredDescription
DescriptionformstringYesInformation about the response.
HeadingformstringYesHeading or summary of the response.
WasSuccessfulformbooleanYesDid the intended operation for this response complete successfully?

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

HTTP + XML

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

POST /subscription/{EventType} HTTP/1.1 
Host: 1fetch.api.client.prod.86degrees.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<AddSubscription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WebService.ClientServiceModel">
  <ApiKey xmlns="http://schemas.datacontract.org/2004/07/WebService.ClientServiceModel.Base">String</ApiKey>
  <EventType>DriverOnTheWay</EventType>
  <SubscriptionUrl>String</SubscriptionUrl>
</AddSubscription>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ApiServiceResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WebService.ClientServiceModel.Base">
  <Description>String</Description>
  <Heading>String</Heading>
  <WasSuccessful>false</WasSuccessful>
</ApiServiceResponse>