Description:

  • Update / Store Booking Information

Version:

Ver. Maker Established Date Revision Date
1.0.0 lenny 2025-07-28

Request URL:

Request Method:

  • POST

Request Header:

Parameter Name Whether Must Type Instructions
Content-Type Yes string Request Type: application/json

Request Parameter:

Parameter Name Whether Must Type Instructions
TripID Yes string trip id
Origin Yes string the route of origin
Destination Yes string the route of destination
ContainerNo Yes string container No.
Type Yes Int 1:A 2:S
FTokenID Yes string Token

Return Example:

Return when correct:

**Note: When the value of Type changes, the returned TripID will also change**
{
    "Result": 200,
    "Message": "success",
    "FObject": [
        {
            "TripID": "BOC-S-07292025-0001"
        }
    ]
}

Return on error:

{
    "Result": 105,
    "Message": "Fail:param is null",
    "FObject": null
}

{
    "Result": 105,
    "Message": "Fail:The send dispatch request operation has been executed. Modification is prohibited. ",
    "FObject": null
}

{
    "Result": 105,
    "Message": "Fail:without this trip ID",
    "FObject": null
}

{
    "Result": 105,
    "Message": "Fail:without this route",
    "FObject": null
}

{
    "Result": 105,
    "Message": "Fail:other error",
    "FObject": null
}

{
    "Result": 105,
    "Message": "Fail:token error or timeout",
    "FObject": null
}

Return Parameter Description:

Parameter Name Type Instructions
TripID String Trip ID

Request Example:

String result = "";
//request url
String url ="http://icloud.assetscontrols.com::8092/api/AscentPH/UpdateBookingInformation";
//request paramter,jsonString
String jsonParam ="{TripID:"BOC-A-12312021-0002bc",Origin:"abc",Destination:"bcd",ContainerNo:"0169",Type:1,FTokenID:'DB7F20D9-84C3-44C3-B05A-06A9C392A111'}";
// httpPost request
HttpPost httpPost = new HttpPost(url);
 // Add configuration information
 httpPost.setConfig(config);
 httpPost.setHeader("Content-Type", "application/json");
 if(jsonParam.length()>0){
    httpPost.setEntity(new StringEntity(jsonParam,            ContentType.create("application/json", "utf-8")));
    HttpResponse response = httpClient.execute(httpPost);
 if (response != null && response.getStatusLine().getStatusCode() == 200) {
     result = EntityUtils.toString(response.getEntity());
     }
   }
 return result;

C#:

///request url
string url = "http://icloud.assetscontrols.com::8092/api/AscentPH/UpdateBookingInformation";  
//request paramter ,jsonString
string body = "{Origin:"abc",Destination:"bcd",ContainerNo:"0169",FTokenID:"DB7F20D9-84C3-44C3-B05A-06A9C392A111",TripID:"BOC-A-12312021-0002bc"}"; 
Encoding encoding = Encoding.UTF8;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
 //request type post / get
request.Method = "post"; 
request.Accept = "*/*";    
request.ContentType = "application/json";
request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)";
byte[] buffer = encoding.GetBytes(body);
request.ContentLength = buffer.Length;
request.GetRequestStream().Write(buffer, 0, buffer.Length);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
using (StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8))
{
    //return jsonString
    return reader.ReadToEnd();
}

Python:

url = 'http://icloud.assetscontrols.com::8092/api/AscentPH/UpdateBookingInformation'
      data = {
      'TripID': 'BOC-A-12312021-0002bc''Origin': 'abc''Destination': 'bcd''ContainerNo':'0186''Type':1'FTokenID':'DB7F20D9-84C3-44C3-B05A-06A9C392A111'
       }
      data = parse.urlencode(data).encode('utf-8')
      headers = {
       'User-Agent': r'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) '
                     r'Chrome/45.0.2454.85 Safari/537.36 115Browser/6.0.3',
       'Connection': 'keep-alive'
       }
      req = request.Request(url, headers=headers, data=data)  
      page = request.urlopen(req).read()
      page = page.decode('utf-8')
      # json_array = json.loads(page)
      return page;

Node.js:

文档更新时间: 2025-07-29 10:42   作者:刘家帅