Depending on applicable regulations or business limitations, specific API requests may not be available for your use.
Create a Model
This request creates a Model Folio.
Request URL
Syntax | POST /restapi/models |
---|---|
Example URL | https://api.uat.foliofn.com/restapi/models |
Request Data Fields
Field | Required? | Description |
---|---|---|
folioName | Yes |
The name of the Model Folio. Also called short name. Cannot be over 25 characters and cannot be blank (“”). |
longName | Yes |
The long name of the Model Folio. Cannot be over 64 characters and cannot be blank (“”). |
description | No |
Description of the model. Cannot be over 255 characters. |
URL | No |
HTTP address containing more information regarding the Model Folio. |
style | Yes |
Model style code. See Model Style Codes for detail. Cannot be blank (“”). |
tradePctThreshold | No |
Percentage Trade Threshold–the minimum percentage by which a security’s current weight within a folio must deviate from the target weight. Defaults to 0.00. See Percentage Trade Threshold for more information. |
publishedStatus | No |
Set to “P” or “U” to create a published or unpublished model. Defaults to unpublished. An unpublished model is only accessible directly from folioinstitutional.com, and cannot be updated or modified through the API. Clients are also not able to subscribe to an unpublished model. |
benchmarkItem | No |
The model’s benchmark. Can be a ticker symbol or an index symbol. Custom benchmarks are not supported by the REST API at this time. |
targetWeights | Yes |
The securities’ target allocation percentages in the model. For each security, provide target weight and ticker symbol. Ticker symbols must be valid; target weights must sum to 100.00; each weight must be given as a percentage, to two decimal places. Do not provide currentWeight when creating a model. |
Request Example
POST /restapi/models HTTP/1.1
Content-Type: application/json
{
"folioName":"Full Name of Model Folio",
"longName":"Long name",
"description":"Model's description",
"URL":"http://mymodel.com",
"style":"LC",
"tracePctThreshold":"1.00",
"publishedStatus":"P",
"benchmarkItem":"^SPX",
"targetWeights": [
{
"targetWeight":"30.00",
"ticker":"IBM"
},
{
"targetWeight":"35.00",
"alertLevel":"all"
},
{
"targetWeight":"35.00",
"ticker":"ORCL"
}
]
}
Response Example
Returns the modelFolioOid of the new Model Folio upon successful creation.
HTTP/1.1 200 OK
X-Powered-By: Servlet/2.5
Location: http://api.uat.foliofn.com/restapi/models/1234567890123
Content-Type: application/json
Date: Fri, 23 Oct 2015 20:15:08 GMT
1234567890123
Error Codes
Code | Explanation |
---|---|
model.creation.failed.need.folio.name | folioName was not provided. |
model.creation.failed.need.long.name | longName was not provided. |
model.creation.failed.need.target.weights | No targetWeights were provided. |
model.creation.failed.need.style | Style was provided. |
model.creation.failed.no.model.account.for.member | No Model Manager Watch Account was found. |
ticker.not.found | An invalid ticker symbol was provided. |
ticker.not.window.tradeable | A ticker symbol was provided which cannot be traded in windows. |
weights.do.not.sum.to.100 | Target weights do not sum to 100.00. |
current.weight.must.be.null.for.updates | Do not give current weights for create/update a Model. |
target.weight.positive.and.has.right.scale.rule | A target weight was given which was either negative or was not to 2 decimal places. |
length must be between 0 and 25 | folioName was over 25 characters. |
length must be between 0 and 64 | longName was over 64 characters. |
length must be between 0 and 255 | Description was over 255 characters. |
model.creation.failed.invalid.benchmark.item | An invalid benchmarkItem was provided. |
model.creation.failed.post.folio.order | Could not post initial Folio orders for the Model Folio. |
model.creation.failed.place.sync.request | Could not place initial Sync Request for the Model Folio. |
model.creation.failed.create.model | Model Creation failed for some other reason. |
Change Log
12/01/2017
- Fix syntax error: replace shortName by longName
03/10/2017
- Updated Request Data Field Descriptions.
07/22/2016
- Updated Example URL
04/29/2016
- Added Change Log