RESTful HTTP Request and Response Examples
This section provides examples of RESTful HTTP Request and Response.
The RESTful HTTP Requests are categorized according to method types as the following:
POST Method
The RESTful HTTP Request POST method is equivalent to Create functions and INSERT SQL statement.
The following example is to insert a new partner, Partner1, in ConfigStore database.
GET Method
The RESTful HTTP Request GET method is equivalent to the Retrieve functions and Select SQL statement.
This following example is to retrieve values of enabled EZComm protocol of partner Buyer:
HTTP Message Type | Example |
---|---|
Request | http://localhost:8090/tpmRest/v1/participants/enabledProtocolPropertyValues?participantName=Buyer &protocol=EZComm&names=["AllowOverrideFilename","dupDetectOutbound","dupDetectInbound"] |
Response | {"result": [ false, false, false ]} |
This following example is to retrieve enabled EZComm protocol property names from a partner:
HTTP Message Type | Example |
---|---|
Request | http://localhost:8090/tpmRest/v1/participants/partnerpropertydefinitions?protocol=EZComm |
Response | {"result":[{"defaultValue":null,"displayName":"Allow override of filename via HTTP parameter","name":"AllowOverrideFilename","type":"boolean"}, {"defaultValue":null,"displayName":"Duplicate Detection for Outbound","name":"dupDetectOutbound","type":"boolean"}, {"defaultValue":null,"displayName":"Duplicate Detection for Inbound","name":"dupDetectInbound","type":"boolean"}, {"defaultValue":null,"displayName":"Use tibXML Packaging","name":"tibXMLPublicMsgFormat","type":"boolean"}, {"defaultValue":null,"displayName":"Store and Forward Authentication Mode","name":"SFAuthenticationMode","type":"string"}, {"defaultValue":null,"displayName":"Store and Forward Authentication Mode Proxy Agent","name":"ProxySFAuthenticationMode","type":"string"} ]} |
This following example is to retrieve enabled EZComm protocol transport properties of partner Partner1:
HTTP Message Type | Example |
---|---|
Request | http://localhost:8090/tpmRest/v1/participants/transports/all?participantName=partner1&protocolName=EZComm |
Response | {"result":[{"name":"file","type":"FILE"},{"name":"http","type":"HTTP"}]} |
This following example is to retrieve the reference value of the FileScriptFile property of a File transport named file under the EZComm protocol for partner Partner1:
HTTP Message Type | Example |
---|---|
Request | http://localhost:8090/tpmRest/v1/participants/transportPropertyValues?participantName=partner1&protocolName=EZComm& transportName=file&names=["FileScriptsFile"] |
Response |
{"result":["c:/temp/rest/db.properties"]} |
This following example is to retrieve the reference value of the FileScriptFile property of a File transport named file under the EZComm protocol for partner Partner1:
HTTP Message Type | Example |
---|---|
Request | http://localhost:8090/tpmRest/v1/participants/transportPropertyValues?participantName=partner1 &protocolName=EZComm&transportName=file&names=["FileScriptsFile.reference"] |
Response | {"result":["c:/temp/rest/db.properties"]} |
This following example is to retrieve the content value of the FileScriptFile property of a File transport named file under the EZComm protocol for partner Partner1:
HTTP Message Type | Example |
---|---|
Request | http://localhost:8090/tpmRest/v1/participants/transportPropertyValues?participantName=partner1 &protocolName=EZComm&transportName=file&names=["FileScriptsFile.content"] |
Response | {"result":["ZGIuZHJpdmVyPW9yYWNsZS5qZGJjLk9yYWNsZURyaXZlcg0KZGIudXJsPWpkYmM6b3JhY2xlOnRoaW46QHRhbnRvbnk tZHQ6MTUyMTpYRQ0KZGIudXNlcj1iYw0KZGIucGFzc3dvcmQ9YmM="]} |
This following example is to retrieve the private key with alias name bcpartner1_key.p12 of partner Partner1 in PKCS format:
PUT Method
The RESTful HTTP Request PUT method is equivalent to Update functions and UPDATE SQL statement.
The following is an example to update the certificate credential of a participant in a ConfigStore database.