For a deeper look into our DataScope Select SOAP API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
3 0 0 0

What is the difference between UsersContext and AuthenticationContext?

In Dss.Api.Examples.Authentication.AuthorizationExamples both are used to get session token. Are there any recommendations when to use which?

dssauthenticationdss-soap-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

1 Answer

Upvotes
23k 22 9 14

Hello @ihor.fedoryshyn ,

If you require to authenticate, both AuthenticationContext and UsersContext work, and you can:

var authenticationContext = ContextHelper.CreateAuthenticationContext(false);
            Status.Notify(authenticationContext, null, "RequestToken", MethodType.Operation, Publish.Secondary
            var sessionToken = authenticationContext.SessionToken;

UsersContext additionally it includes User preferences handling capabilities:

   [GeneratedCode("Microsoft.OData.Client.Design.T4", "1.0.0")]
        public IDssQueryable<UserClaim> UserClaims { get; }
        [GeneratedCode("Microsoft.OData.Client.Design.T4", "1.0.0")]
        public IDssQueryable<UserPreference> UserPreferences { get; }
        [GeneratedCode("Microsoft.OData.Client.Design.T4", "1.0.0")]
        public IDssQueryable<User> Users { get; }
        public IUserClaimOperations UserClaimOperations { get; }
        public IUserClaimOperationsAsync UserClaimOperationsAsync { get; }
        public IUserPreferenceOperations UserPreferenceOperations { get; }
        public IUserPreferenceOperationsAsync UserPreferenceOperationsAsync { get; }
        public IUserOperations UserOperations { get; }
        public IUserOperationsAsync UserOperationsAsync { get; }

For example:

var UsersContext = new UsersContext(new Uri("https://selectapi.datascope.refinitiv.com/RestApi/v1/"), "<your user id>", "<your password>");

//Fetch the user preferences
var userPreferences = UsersContext.UserPreferenceOperations.GetAll().First();

//Make changes
userPreferences.ContentSettings.PartialEmbargoedReportsEnabled = false;
UsersContext.UserPreferenceOperations.Update(userPreferences);

For illustrative examples of usage, see Refinitiv DSS C# Example Application -> section "User Examples",

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea