Depending on applicable regulations or business limitations, specific API requests may not be available for your use.

Update a Model

This request updates a specific model. Some Model Settings may be updated, along with Target Weights.

Request URL

Syntax PUT /restapi/models/{modeloid}
Example URL https://api.uat.foliofn.com/restapi/models/1234567890123

Request Data Fields

Fields which are not listed are not updateable. Fields omitted from the request will not be updated. For example, if folioName is not present in the request, folioName will not be updated. This way, you only have to send fields that are to be updated.

Field Description
folioNumber

Required. The unique folio number of the model. Not updateable, but required for verification.

folioName

The name of the Model Folio. Also called short name. Cannot be over 25 characters and cannot be blank (“”).

longName

The long name of the Model Folio. Cannot be over 64 characters and cannot be blank (“”).

description

Description of the model. Cannot be over 255 characters.

URL

HTTP address containing more information regarding the Model Folio.

style

Model style code. See Model Style Codes for detail. Cannot be blank (“”).

tradePctThreshold

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

Set to “P” or “U” to publish or unpublish the model. Cannot be blank (“”)

benchmarkItem

Set to update the model’s benchmark. Can be a ticker symbol or an index symbol. If blank (“”), benchmarkItem will not be updated. Custom benchmarks are not supported by the REST API at this time.

targetWeights

The securities’ new 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 for updates. If an empty list of tickers is provided, targetWeights will not be updated.

Request Example


PUT /restapi/models/1234567890123 HTTP/1.1
Content-Type: application/json
{
    "folioNumber":"9A1322500T2M",
    "folioName":"Full Name of Model Folio",
    "longName":"Long name",
    "description":"Model's description",
    "URL":"http://mymodel.com",
    "style":"LC",
    "tradePctThreshold":"1.00",
    "publishedStatus":"P",
    "benchmarkItem":"^SPX",
    "targetWeights":  [
    	{
    		"targetWeight":"30.00",
    		"ticker":"IBM"
    	},
    	{
    		"targetWeight":"35.00",
    		"ticker":"MSFT"
    	},
    	{
    		"targetWeight":"35.00",
    		"ticker":"ORCL"
    	}
    ]
}

Response Example

Returns the modelFolioOid upon a successful update.


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

Notes

Only the member who created the model can update the model. A Model with active subscriptions cannot be unpublished.

Error Codes

The following error codes may be returned.

Error code Explanation
model.update.failed.folio.name.blank folioName cannot be blank (“”).
model.update.failed.long.name.blank longName cannot be blank (“”).
model.update.failed.style.blank style cannot be blank (“”).
model.update.failed.published.status.blank publishedStatus cannot be blank (“”).
model.update.failed.no.folio.number.provided folioNumber must be provided.
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.update.failed.model.has.different.member The member who is updating the model must be the same member who created the model.
model.update.failed.invalid.benchmark.item An invalid benchmarkItem was provided.
model.update.failed.modelfoliooid.mismatch The folioNumber provided in the REST body does not correspond to the modelFolioOid of the REST URL.
cannot.unpublish.model.with.subscriptions A model with active subscriptions cannot be unpublished.

Change Log

12/01/2017

  1. Fix syntax: replace shortName by longName

08/18/2017

  1. Updated Request URL Syntax

08/19/2016

  1. Updated Request URL Syntax
  2. Added Notes Section

4/29/2016

  1. Added Change Log

Getting Started

REST APIs

Resources