skip to main content
Corticon Server: Integration & Deployment Guide : Request and response examples : JSON/RESTful request and response messages : Sample JSON request and response messages
 

Try Corticon Now
Sample JSON request and response messages
The following code presents the input and output of the TradeAllocation sample's AllocateTrade Tester.
JSON Input:

{
"Objects": [{
"dMarketValueBeforeTrade": "10216333.000000",
"price": "950.000000",
"transaction": [
{
"account": [{
"maxPctHiYield": "35.000000",
"dPositionHiYield": "330000.000000",
"dPositionHiGrade": "819167.000000",
"securityPosition": [
{
"quantity": "5000",
"dMarketValue": "819167.000000",
"security": [{
"symbol": "PMBND",
"yield": "6.000000",
"daysInHolding": "23",
"dMarketValue": "164.000000",
"dProfile": "HI-GRD",
"dAnnualInterestAmt": "60.000000",
"price": "160.000000",
"issuer": "Phillip Morris",
"sin": "Y",
"dAccruedInterest": "4.000000",
"faceValue": "1000.000000",
"rating": "A",
"__metadata": {
"#id": "Security_id_1",
"#type": "Security"
}
}],
"__metadata": {
"#id": "SecurityPosition_id_1",
"#type": "SecurityPosition"
}
},
{
"quantity": "3000",
"dMarketValue": "330000.000000",
"security": [{
"symbol": "3MBND",
"yield": "12.000000",
"daysInHolding": "40",
"dMarketValue": "110.000000",
"dProfile": "HI-YLD",
"dAnnualInterestAmt": "90.000000",
"price": "100.000000",
"issuer": "3M",
"sin": "N",
"dAccruedInterest": "10.000000",
"faceValue": "1000.000000",
"rating": "B",
"__metadata": {
"#id": "Security_id_3",
"#type": "Security"
}
}],
"__metadata": {
"#id": "SecurityPosition_id_2",
"#type": "SecurityPosition"
}
}
],
"warnMargin": "3.000000",
"name": "Boeing",
"restricted": "false",
"maxPctHiGrade": "75.000000",
"number": "1640",
"dMarketValue": "1149167.000000",
"__metadata": {
"#id": "Account_id_1",
"#type": "Account"
}
}],
"security": [{"__metadata": {"#ref_id": "Security_id_2"}}],
"__metadata": {
"#id": "Transaction_id_1",
"#type": "Transaction"
}
},
{
"account": [{
"maxPctHiYield": "65.000000",
"dPositionHiYield": "2495556.000000",
"dPositionHiGrade": "819167.000000",
"securityPosition": [
{
"quantity": "5000",
"dMarketValue": "819167.000000",
"security": [{"__metadata": {"#ref_id": "Security_id_1"}}],
"__metadata": {
"#id": "SecurityPosition_id_3",
"#type": "SecurityPosition"
}
},
{
"quantity": "2000",
"dMarketValue": "295556.000000",
"security": [{"__metadata": {"#ref_id": "Security_id_2"}}],
"__metadata": {
"#id": "SecurityPosition_id_4",
"#type": "SecurityPosition"
}
},
{
"quantity": "20000",
"dMarketValue": "2200000.000000",
"security": [{"__metadata": {"#ref_id": "Security_id_3"}}],
"__metadata": {
"#id": "SecurityPosition_id_5",
"#type": "SecurityPosition"
}
}
],
"warnMargin": "3.000000",
"name": "Sears",
"restricted": "true",
"maxPctHiGrade": "45.000000",
"number": "1920",
"dMarketValue": "3314722.000000",
"__metadata": {
"#id": "Account_id_2",
"#type": "Account"
}
}],
"security": [{"__metadata": {"#ref_id": "Security_id_2"}}],
"__metadata": {
"#id": "Transaction_id_2",
"#type": "Transaction"
}
},
{
"account": [{
"maxPctHiYield": "70.000000",
"dPositionHiYield": "4769444.000000",
"dPositionHiGrade": "983000.000000",
"securityPosition": [
{
"quantity": "6000",
"dMarketValue": "983000.000000",
"security": [{"__metadata": {"#ref_id": "Security_id_1"}}],
"__metadata": {
"#id": "SecurityPosition_id_6",
"#type": "SecurityPosition"
}
},
{
"quantity": "2500",
"dMarketValue": "369444.000000",
"security": [{"__metadata": {"#ref_id": "Security_id_2"}}],
"__metadata": {
"#id": "SecurityPosition_id_7",
"#type": "SecurityPosition"
}
},
{
"quantity": "40000",
"dMarketValue": "4400000.000000",
"security": [{"__metadata": {"#ref_id": "Security_id_3"}}],
"__metadata": {
"#id": "SecurityPosition_id_8",
"#type": "SecurityPosition"
}
}
],
"warnMargin": "2.000000",
"name": "Airbus",
"restricted": "false",
"maxPctHiGrade": "35.000000",
"number": "2750",
"dMarketValue": "5752444.000000",
"__metadata": {
"#id": "Account_id_3",
"#type": "Account"
}
}],
"security": [{"__metadata": {"#ref_id": "Security_id_2"}}],
"__metadata": {
"#id": "Transaction_id_3",
"#type": "Transaction"
}
}
],
"dAccruedInterest": "38889.000000",
"quantity": "5000.000000",
"security": {
"symbol": "BGBND",
"yield": "11.000000",
"daysInHolding": "40",
"dMarketValue": "148.000000",
"dProfile": "HI-YLD",
"dAnnualInterestAmt": "80.000000",
"price": "140.000000",
"issuer": "Boeing",
"sin": "N",
"dAccruedInterest": "8.000000",
"faceValue": "1000.000000",
"rating": "BBB",
"__metadata": {
"#id": "Security_id_2",
"#type": "Security"
}
},
"__metadata": {
"#id": "Trade_id_1",
"#type": "Trade"
}
}],
"__metadataRoot": {
"#restrictInfoRuleMessages": "true",
"#restrictViolationRuleMessages": "true",
"#restrictWarningRuleMessages": "false"
}
}
JSON TRANSLATION = 78
JSON Output:

{
"Messages": {
"Message": [
{
"entityReference": "Trade_id_1",
"text": "[AccountConstraint,5] A restricted account [ Sears ] can't be involved in a trade.",
"severity": "Warning",
"__metadata": {"#type": "#RuleMessage"}
},
{
"entityReference": "Trade_id_1",
"text": "[AccountConstraint,4] No account [ Airbus ] involved in a trade can exceed
its maximum percentage [ 70.000000 ] for High Yield securities [ 86.156842 ].",
"severity": "Warning",
"__metadata": {"#type": "#RuleMessage"}
},
{
"entityReference": "Trade_id_1",
"text": "[AccountConstraint,4] No account [ Sears ] involved in a trade can exceed
its maximum percentage [ 65.000000 ] for High Yield securities [ 79.980241 ].",
"severity": "Warning",
"__metadata": {"#type": "#RuleMessage"}
},
{
"entityReference": "Trade_id_1",
"text": "[AccountConstraint,4] No account [ Boeing ] involved in a trade can exceed
its maximum percentage [ 35.000000 ] for High Yield securities [ 42.253808 ].",
"severity": "Warning",
"__metadata": {"#type": "#RuleMessage"}
}
],
"__metadata": {"#type": "#RuleMessages"},
"version": "0.0"
},
"Objects": [{
"dMarketValueBeforeTrade": 20432666,
"price": "950.000000",
"transaction": [
{
"dPositionHiGrade": 0,
"dPositionHiYield": 269397.538944,
"dAccruedInterest": 2249.666294,
"dActualQuantity": 281.208287,
"account": [{
"dPctHiYield": 42.253808,
"dPositionHiYield": "330000.000000",
"dNewPositionHiGrade": 819167,
"maxPctHiGrade": "75.000000",
"restricted": "false",
"dMarketValue": "1149167.000000",
"number": "1640",
"dPositionHiGrade": "819167.000000",
"maxPctHiYield": "35.000000",
"dNewPositionHiYield": 599397.538944,
"name": "Boeing",
"warnMargin": "3.000000",
"securityPosition": [
{
"quantity": "5000",
"dMarketValue": "819167.000000",
"security": [{
"symbol": "PMBND",
"yield": "6.000000",
"daysInHolding": "23",
"dMarketValue": "164.000000",
"dProfile": "HI-GRD",
"dAnnualInterestAmt": "60.000000",
"price": "160.000000",
"issuer": "Phillip Morris",
"sin": "Y",
"dAccruedInterest": "4.000000",
"faceValue": "1000.000000",
"rating": "A",
"__metadata":
{
"#id": "Security_id_1",
"#type": "Security"
}
}],
"__metadata":{
"#id": "SecurityPosition_id_1",
"#type": "SecurityPosition"
}
},
{
"quantity": "3000",
"dMarketValue": "330000.000000",
"security": [{
"symbol": "3MBND",
"yield": "12.000000",
"daysInHolding": "40",
"dMarketValue": "110.000000",
"dProfile": "HI-YLD",
"dAnnualInterestAmt": "90.000000",
"price": "100.000000",
"issuer": "3M",
"sin": "N",
"dAccruedInterest": "10.000000",
"faceValue": "1000.000000",
"rating": "B",
"__metadata":{
"#id": "Security_id_3",
"#type": "Security"
}
}],
"__metadata":{
"#id": "SecurityPosition_id_2",
"#type": "SecurityPosition"
}
}
],
"__metadata":{
"#id": "Account_id_1",
"#type": "Account"
},
"dNewMarketValue": 1418564.538944,
"dPctHiGrade": 57.746192
}],
"dMarketValue": 269397.538944,
"security": [{"__metadata": {"#ref_id": "Security_id_2"}}],
"dQuantity": 281.208287,
"__metadata":{
"#id": "Transaction_id_1",
"#type": "Transaction"
},
"dPrice": 950
},
{
"dPositionHiGrade": 0,
"dPositionHiYield": 777065.429329,
"dAccruedInterest": 6489.064129,
"dActualQuantity": 811.133016,
"account": [{
"dPctHiYield": 79.980241,
"dPositionHiYield": "2495556.000000",
"dNewPositionHiGrade": 819167,
"maxPctHiGrade": "45.000000",
"restricted": "true",
"dMarketValue": "3314722.000000",
"number": "1920",
"dPositionHiGrade": "819167.000000",
"maxPctHiYield": "65.000000",
"dNewPositionHiYield": 3272621.429329,
"name": "Sears",
"warnMargin": "3.000000",
"securityPosition": [{
"quantity": "5000",
"dMarketValue": "819167.000000",
"security": [{"__metadata": {"#ref_id": "Security_id_1"}}],
"__metadata": {
"#id": "SecurityPosition_id_3",
"#type": "SecurityPosition"
}
},
{
"quantity": "2000",
"dMarketValue": "295556.000000",
"security": [{"__metadata": {"#ref_id": "Security_id_2"}}],
"__metadata": {
"#id": "SecurityPosition_id_4",
"#type": "SecurityPosition"
}
},
{
"quantity": "20000",
"dMarketValue": "2200000.000000",
"security": [{"__metadata": {"#ref_id": "Security_id_3"}}],
"__metadata": {
"#id": "SecurityPosition_id_5",
"#type": "SecurityPosition"
}
}
],
"__metadata":{
"#id": "Account_id_2",
"#type": "Account"
},
"dNewMarketValue": 4091787.429329,
"dPctHiGrade": 20.019784
}],
"dMarketValue": 777065.429329,
"security": [{"__metadata": {"#ref_id": "Security_id_2"}}],
"dQuantity": 811.133016,
"__metadata": {
"#id": "Transaction_id_2",
"#type": "Transaction"
},
"dPrice": 950
},
{
"dPositionHiGrade": 0,
"dPositionHiYield": 1348537.031727,
"dAccruedInterest": 11261.269577,
"dActualQuantity": 1407.658697,
"account": [{
"dPctHiYield": 86.156842,
"dPositionHiYield": "4769444.000000",
"dNewPositionHiGrade": 983000,
"maxPctHiGrade": "35.000000",
"restricted": "false",
"dMarketValue": "5752444.000000",
"number": "2750",
"dPositionHiGrade": "983000.000000",
"maxPctHiYield": "70.000000",
"dNewPositionHiYield": 6117981.031727,
"name": "Airbus",
"warnMargin": "2.000000",
"securityPosition": [{
"quantity": "6000",
"dMarketValue": "983000.000000",
"security": [{"__metadata": {"#ref_id": "Security_id_1"}}],
"__metadata": {
"#id": "SecurityPosition_id_6",
"#type": "SecurityPosition"
}
},
{
"quantity": "2500",
"dMarketValue": "369444.000000",
"security": [{"__metadata": {"#ref_id": "Security_id_2"}}],
"__metadata": {
"#id": "SecurityPosition_id_7",
"#type": "SecurityPosition"
}
},
{
"quantity": "40000",
"dMarketValue": "4400000.000000",
"security": [{"__metadata": {"#ref_id": "Security_id_3"}}],
"__metadata": {
"#id": "SecurityPosition_id_8",
"#type": "SecurityPosition"
}
}
],
"__metadata": {
"#id": "Account_id_3",
"#type": "Account"
},
"dNewMarketValue": 7100981.031727,
"dPctHiGrade": 13.843158
}],
"dMarketValue": 1348537.031727,
"security": [{"__metadata": {"#ref_id": "Security_id_2"}}],
"dQuantity": 1407.658697,
"__metadata": {
"#id": "Transaction_id_3",
"#type": "Transaction"
},
"dPrice": 950
}
],
"dAccruedInterest": 40000,
"quantity": "5000.000000",
"security": {
"symbol": "BGBND",
"yield": "11.000000",
"daysInHolding": "40",
"dMarketValue": "148.000000",
"dProfile": "HI-YLD",
"dAnnualInterestAmt": "80.000000",
"price": "140.000000",
"issuer": "Boeing",
"sin": "N",
"dAccruedInterest": "8.000000",
"faceValue": "1000.000000",
"rating": "BBB",
"__metadata": {
"#id": "Security_id_2",
"#type": "Security"
}
},
"__metadata": {
"#id": "Trade_id_1",
"#type": "Trade"
}
}],
"__metadataRoot": {
"#restrictInfoRuleMessages": "true",
"#restrictViolationRuleMessages": "true",
"#restrictWarningRuleMessages": "false"
}
}

Testing a JSON request

Your Corticon Server installation implements Swagger. From your browser at http://localhost:8850/axis/swagger/ you can use Execute Decision Service to set up the dsname and a sample request's JSON Objects to run against a deployed Decision Service. See Swagger for more information.