Skip to content
This repository was archived by the owner on May 19, 2024. It is now read-only.
This repository was archived by the owner on May 19, 2024. It is now read-only.

Streaming data? #14

Description

@X3Coyote

Hello,
I'm trying to get the user preferences for streaming, but I'm pretty new to Julia. I need access to streaming data.

where would I add this:

function get_user_principals(fields::AbstractString="")
uri = construct_api("userprincipals", ["fields" => fields])
head = ["Authorization" => "Bearer "*AUTH_KEY.ACCESS_TOKEN]
resp = HTTP.get(uri, head)
body = resp.body |> JSON3.read
return body
end

I also have this to use it:

using Pkg, DataFrames, TDAmeritrade, HTTP

TD_auth()

Retrieve user info and preferences for real-time operations

fields = "streamerSubscriptionKeys,streamerConnectionInfo,preferences,surrogateIds"
principals = get_user_principals(fields)

Access the retrieved information

streamerSubscriptionKeys = principals["streamerSubscriptionKeys"]
streamerConnectionInfo = principals["streamerConnectionInfo"]
preferences = principals["preferences"]
surrogateIds = principals["surrogateIds"]

Print or further process the retrieved information

println("Streamer Subscription Keys: $streamerSubscriptionKeys")
println("Streamer Connection Info: $streamerConnectionInfo")
println("Preferences: $preferences")
println("Surrogate IDs: $surrogateIds")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions