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")
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:
I also have this to use it:
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")