Main Content

createFieldList

Create Bloomberg Hypermedia field list for data requests

Since R2023b

Description

example

[fieldListID,response] = createFieldList(c,userCatalog,payload) creates a Bloomberg® Hypermedia field list for data requests, where c is the Bloomberg Hypermedia connection object, userCatalog is your catalog ID from Bloomberg, and payload is a structure that defines the field list.

Examples

collapse all

Create a field list for the data fields you would like to request.

Create a Bloomberg Hypermedia connection object by using the API key provided by Bloomberg.

credentialsString = '{"client_id":"89beaeab724bbdf5e186b733c58af2","client_secret":"77050429aee81eb31793fb10fa4301c54911db545de8b2990252ffe2b56b11","name":"BloombergHAIDevelopment","scopes":["eap","beapData","reportingapi"],"expiration_date":1699198358934,"created_date":1651764758934}'
c = bloombergHypermedia(credentialsString)
c = 
 
  bloombergHypermedia with properties:

      TimeOut: 200.00

Specify your catalog ID and create the payload structure that holds the essential query information required by the Bloomberg Hypermedia data server.

userCatalog = "123";
payload.type = "DataFieldList";
payload.identifier = "fieldList" + bloombergHypermedia.generateResourcePostfix;;
payload.title = "Test Data Field List";
payload.description = "Test data field list";
payload.contains{1}.id = "https://api.bloomberg.com/eap/catalogs/bbg/fields/pxAsk/";
payload.contains{2}.id = "https://api.bloomberg.com/eap/catalogs/bbg/fields/pxLast/";
payload.contains{3}.id = "https://api.bloomberg.com/eap/catalogs/bbg/fields/idBbGlobal/";

Use the createFieldList function to create the field list.

[fieldListID,response] = createFieldList(c,userCatalog,payload)
fieldListID = 
  
      "fieldList20220524131412b9a77b"
  
  
response = 
  
       ResponseMessage with properties:
  
         StatusLine: 'HTTP/1.1 201 CREATED'
         StatusCode: Created
            Header: [1×14 matlab.net.http.HeaderField]
              Body: [1×1 matlab.net.http.MessageBody]
         Completed: 1

After creating the field list, you can use this output to create a data request by using the createRequest function.

Input Arguments

collapse all

Bloomberg Hypermedia connection, specified as a Bloomberg Hypermedia object.

User catalog identifier, specified as a character vector or string scalar.

Field list information, specified as a structure array.

Output Arguments

collapse all

Field list identifier, returned as a string scalar.

HTTP request response, returned as a ResponseMessage object. For details, see matlab.net.http.ResponseMessage.

Version History

Introduced in R2023b