Investment Portfolio

Preview

Investment Portfolio

+ Day(s) remaining in the trial

Overview

The Investment Portfolio service lets you store, update, and query your investment portfolios and associated holdings using flexible object definitions so you can store more information without worrying about format. With outstanding performance, flexible storage, filtering, and data retrieval, you can make informed and timely investment decisions quickly.

Security

Keys

Pick a key to use with this API. Make sure you are logged in with your IBM id for your keys to be populated in the dropdown below. By selecting a key, it will be pre-filled for each endpoint in the Documentation section that can be used with the built-in testing. If you want to change which key to use for a particular endpoint, you can do so at the endpoint in the Documentation section.
You can manage your API keys in the <MyAPIs> section. API keys authenticate you to your subscription, so make sure to keep them secret. Do not share the X-IBM-Client-Secret portion of any API key in publicly accessible places such as GitHub, or client-side code.



Manage your keys
 

Global Parameters

This section contains global variables, which apply to all of the endpoint definitions of this API. You can use this section to set these variables once, and have the values pre-filled for every endpoint in the Documentation section. The values set can be used with the built-in testing. You can always override the value in the endpoint definition of the Documentation section.
Global variables

Documentation

Investment Portfolio:

Holdings

Create holdings
This operation creates holdings associated with the specified portfolio entry. Use the portfolioName parameter to specify the portfolio with which to associate the new holdings. New holdings must have a timestamp specifying a date and time either on or after the date and time specified by the timestamp of the associated portfolio.

POST   /portfolios/{portfolioName}/holdings

			{hostname}/portfolios/{portfolioName}/holdings
		
Keys
Global variables

hostname

BASEURL , required

Path and Query parameters

portfolioName

URL , required

Name of the portfolio to associate holdings with

Request code
								
HttpResponse<String> response = Unirest.post("https://ibm.com/api/v1/portfolios/{portfolioName}/holdings") .header("accept", "application/json") .header("content-type", "application/json") .header("authorization", "Basic REPLACE_BASIC_AUTH") .body("{\"holdings\":\"string\",\"timestamp\":\"string\"}") .asString();
Request model

holdings

STRING , optional

timestamp

STRING , optional

Request example
{
  "holdings": string,
  "timestamp": string
}
Response model

200

Successful operation.

400

Invalid request. See description for details.

404

Portfolio does not exist.

Response example

200

Successful operation.

400

Invalid request. See description for details.

404

Portfolio does not exist.

Create multiple holdings
This operation creates or updates multiple holdings at once. For example, you can limit a number of writes to a single command by using this operation to create two new holdings and update three more. To update an existing holding, include the _rev property in the definition.

POST   /portfolios/{portfolioName}/bulk_holdings

			{hostname}/portfolios/{portfolioName}/bulk_holdings
		
Keys
Global variables

hostname

BASEURL , required

Path and Query parameters

portfolioName

URL , required

Name of the portfolio holdings are associated with

Request code
								
HttpResponse<String> response = Unirest.post("https://ibm.com/api/v1/portfolios/{portfolioName}/bulk_holdings") .header("accept", "application/json") .header("content-type", "application/json") .header("authorization", "Basic REPLACE_BASIC_AUTH") .asString();
Request model

_rev

STRING , optional

holdings

OBJECT , optional

timestamp

STRING , optional

Request example
[{
  "_rev": string,
  "holdings": object,
  "timestamp": string
}]
Response model

201

Successful operation. See result for status of each holdings definition in the array.

Body

error

STRING , optional

id

STRING , optional

ok

BOOLEAN , optional

reason

STRING , optional

rev

STRING , optional

400

Invalid request. See description for details.

404

Portfolio does not exist.

Response example

201

Successful operation. See result for status of each holdings definition in the array.

								[{
  "error" : string,
  "id" : string,
  "ok" : boolean,
  "reason" : string,
  "rev" : string
}]
							

400

Invalid request. See description for details.

404

Portfolio does not exist.

Delete holdings
This operation deletes the holdings entry where name and timestamp match.

DELETE   /portfolios/{portfolioName}/holdings/{timestamp}

			{hostname}/portfolios/{portfolioName}/holdings/{timestamp}
		
Keys
Global variables

hostname

BASEURL , required

Path and Query parameters

portfolioName

URL , required

Name of the portfolio the holdings is associated with

rev

STRING , required

The current _rev of the holdings entry

timestamp

URL , required

Date and time of the holdings entry to delete

Request code
								
HttpResponse<String> response = Unirest.delete("https://ibm.com/api/v1/portfolios/{portfolioName}/holdings/{timestamp}?rev=string") .header("accept", "application/json") .header("content-type", "application/json") .header("authorization", "Basic REPLACE_BASIC_AUTH") .asString();
Response model

204

Successful operation.

400

Invalid submission.

404

Holdings for portfolio at timestamp not found.

409

Invalid revision.

Response example

204

Successful operation.

400

Invalid submission.

404

Holdings for portfolio at timestamp not found.

409

Invalid revision.

Get holdings
This operation returns holdings associated with the specified portfolio. Use the latest parameter to retrieve only the holdings for the most recent entry for the specified portfolio, the atDate parameter to retrieve holdings on or before the specified timestamp, and the hasKey parameter to retrieve holdings that have the specified keys defined.

GET   /portfolios/{portfolioName}/holdings

			{hostname}/portfolios/{portfolioName}/holdings
		
Keys
Global variables

hostname

BASEURL , required

Path and Query parameters

atDate

STRING , optional

When the value is a date and time, the holdings with timestamps on or before the specified date and time are returned.

hasKey

ARRAY , optional

When the value contains the names of keys, the holdings that have the specified keys defined are returned. For example, to get holdings with the isin and quantity keys defined, you can either specify hasKey=isin,quantity or you can specify multiple hasKey parameters: hasKey=isin&hasKey=quantity.

latest

STRING , optional

When the value is true, the most recent holdings entry is returned. When the value is false, all holdings are returned. The default value is false.

portfolioName

URL , required

Name of the portfolio holdings are associated with

Request code
								
HttpResponse<String> response = Unirest.get("https://ibm.com/api/v1/portfolios/{portfolioName}/holdings?atDate=string&hasKey=undefined&latest=string") .header("accept", "application/json") .header("authorization", "Basic REPLACE_BASIC_AUTH") .asString();
Response model

200

Successful operation.

Body

_rev

STRING , optional

holdings

OBJECT , optional

timestamp

STRING , optional

404

Portfolio does not exist.

Response example

200

Successful operation.

								[{
  "_rev" : string,
  "holdings" : object,
  "timestamp" : string
}]
							

404

Portfolio does not exist.

Update holdings
This operation updates the holdings entry where portfolio name and timestamp match.

PUT   /portfolios/{portfolioName}/holdings/{timestamp}

			{hostname}/portfolios/{portfolioName}/holdings/{timestamp}
		
Keys
Global variables

hostname

BASEURL , required

Path and Query parameters

portfolioName

URL , required

Name of the portfolio holdings are associated with

timestamp

URL , required

Date and time of the holdings entry to update

Request code
								
HttpResponse<String> response = Unirest.put("https://ibm.com/api/v1/portfolios/{portfolioName}/holdings/{timestamp}") .header("accept", "application/json") .header("content-type", "application/json") .header("authorization", "Basic REPLACE_BASIC_AUTH") .body("{\"_rev\":\"string\",\"holdings\":\"string\"}") .asString();
Request model

_rev

STRING , optional

holdings

STRING , optional

Request example
{
  "_rev": string,
  "holdings": string
}
Response model

200

Successful operation. Returns the new revision _rev.

400

Invalid submission.

404

Portfolio at timestamp not found.

409

Invalid revision.

Response example

200

Successful operation. Returns the new revision _rev.

400

Invalid submission.

404

Portfolio at timestamp not found.

409

Invalid revision.

Loading content...

Resources