[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ftpapi] Help with Sending TMS Event Data using REST



I was wondering if I could get any help.  I need to send TMS Event data to Macropoint using a RESTful web service with the Post verb. I have been perusing the examples, but I  have not found one that look similar to what I am trying to do.  I have used SOAP before, but never REST, and I am unsure how to proceed.  

Has anyone done something similar and could offer me some guidance?


This is the information that they provided me, on what they need sent:


 Send TMS Event Data 
Description Provide TMS Event data to MacroPoint to share with approved partners 
Direction 
Customer to MP LITE 
Return 
MP LITE returns HTTP Status code 201 on success, 400 on bad request and 5xx on server failure 
Security 
Required. Basic Authentication 
XML in POST Request Body 
<TMSStopEventData xmlns="http://macropoint-lite.com/xml/1.0"> 
<Sender> 
<LoadID>{LoadID}</LoadID> 
<VehicleID>{VehicleID}</VehicleID> 
</Sender> 
<Requestor> 
<MPID>{RequestorMacropointID}</MPID> 
<LoadID>{RequestorLoadID}</LoadID> 
</Requestor> 
<Stop> 
<Name>{StopName}</Name> 
<StopType>{StopType}</StopType> 
<Address> 
<Line1>{Line1}</Line1> 
<Line2>{Line2}</Line2> 
<City>{City}</City> 
<StateOrProvince>{StateOrProvince}</StateOrProvince> 
<PostalCode>{PostalCode}</PostalCode> 
<CountryCode>{CountryCode}</CountryCode> 
</Address> 
<StartDateTime>{StartDateTime}</StartDateTime> 
<EndDateTime>{EndDateTime}</EndDateTime> 
<SequenceNumber>{SequenceNumber}</SequenceNumber> 
<StopID>{StopID}</StopID> 
<Notes>{Notes}</Notes> 
<MacroPointStopID> 
{MacroPointStopID} 
</MacroPointStopID> 
</Stop> 
<Event> 
<Name>{EventName}</Name> 
<CompletedDateTime>{CompletedDateTime}</CompletedDateTime> 
<Form> 
<FormItems> 
<FormItem> 
<ItemId>{FormItem1Id}</ItemId> 
<Value>{FormItem1Value}</Value> 
</FormItem> 
<FormItem> 
<ItemId>{FormItem2Id}</ItemId> 
<Value>{FormItem2Value}</Value> 
</FormItem> 
</FormItems> 
</Form> 
</Event> 
</TMSStopEventData> 
Notes 
1. Use HTTP POST verb for this request. HTTP POST XML shown above 

2. Basic Authentication Required. We will supply user id and password 

3. <Sender> is required 

a. {LoadID} is required. Provide the Load ID from your TMS System 

b. {VehicleID} is optional 

4. <Requestor> is optional. Provide this information if you want MacroPoint to try and match an existing TrackingRequest from {RequestorMacroPointID} with LoadID {RequestorLoadID}. 

a. {RequestorMacroPointID} is the MacroPoint ID of partner that created the Tracking Request 

b. {RequestorLoadID} is the ID of the load that your partner assigned to the Tracking Request 

5. <Stop> is required 

a. {StopName} is required and has a 64 character maximum size 

b. {StopType} is required and needs to be one of Pickup or DropOff. 

c. If provided, <Address> has the following components 

i. {Line1} is the first line of the address 

ii. {Line2} is the second line of the address 

iii. {City} is the city of the address 

iv. {StateOrProvince} is the state or province of the address 

v. {PostalCode} is the postal code of the address 

vi. {CountryCode} is the country code of the address in ISO 3166-1 alpha-2 or alpha-3. E.g. USA or US for United States of America 

vii. {Line1}, {Line2}, {City}, and {StateOrProvince} have a 64 character maximum size 

viii. {PostalCode} has a 16 character maximum size 

6. If provided, {StartDateTime} and {EndDateTime} should be in IS0 8601 UTC Format 

a. E.g. 2014-11-04T19:25Z or 2014-11-04T19:25:30Z 

7. If provided, {SequenceNumber} is the sequence of the stop in the tripsheet 


8. {Notes} are any notes relevant to the stop 

9. {StopID} is the internal stop id of the TMS System 

10. {MacroPointStopID} is a reference ID passed by MacroPoint to you in a previous call, identifying the stop 

11. <Event> is required 

a. {EventName} is required and indicates the name of the event that has been completed on the stop. 

b. {CompletedDateTime} is required and indicates when the event was completed on the stop. The date needs to be in ISO 8601 UTC format 
a. E.g. 2014-11-04T19:25Z or 2014-11-04T19:25:30Z 

12. <Form> is optional 

a. If provided, {FormItem…Id} indicates the Id of the form element to be updated 

b. If provided, {FormItem..Value} indicates the updated value for the corresponding FormItem 

13. <FormItem> node can be repeated as many times as there are form values to be submitted/updated. 

When an order is successfully created 
HTTP Status Code 201 is returned 
When an order is NOT successfully created 

1. HTTP Status Code 400 is returned 

2. Response Body: < TMSStopEventDataResult> Entity (shown below) is returned 

<TMSStopEventDataResult> 
<Errors> 
<Error> 
<Code>{Code}</Code> 
<Message>{Message}</Message> 
</Error> 
</Errors> 
</TMSStopEventDataResult> 

3. {Code} indicating the type of error 

a. 1000 – All argument/domain-rule validation exceptions 

b. 9999 – Unexpected error occurred – Administrator notified 

4. {Message} is text explaining the error 

Server cannot process the request 
1. HTTP Status Code 5xx is returned 


2. Response Body: {unspecified
-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi