Page tree
Skip to end of metadata
Go to start of metadata

If connecting as an application, you will need to register an app and make a note of the app key and app secret.The WWClient can be instantiated by calling the static method WWClient.buildClientApplicationAccess(appId, appSecret, authenticationEndpoint). Once built, the WWClient can be authenticated. Once authenticated, all relevant Watson Work Services calls can be made.

Sample Code Block
    @Test(enabled = true)
    @Parameters({ "appId", "appSecret" })
    public void testGetSpacesAsApp(String appId, String appSecret) throws UnsupportedEncodingException, WWException {
        WWClient client = WWClient.buildClientApplicationAccess(appId, appSecret, new WWAuthenticationEndpoint());
        assert !client.isAuthenticated();
        client.authenticate();
        assert client.isAuthenticated();

        List<? extends Space> spaces = client.getSpaces();
        assert (spaces.size() > 0);
    } 

Authentication as an application returns an AppToken which is passed to the authenticationResult property of the WWClient. This includes setting the expiry date for authentication. Subsequent calls using the same WWClient object will check whether the expiry date has passed, in which case it will re-authenticate.

When authenticating as an application, there is no refresh token, so no need to store the AppToken.

6 Comments

  1. Anonymous

    Looking  for someone write my assignment  here are Expert assignment helpers well efficient and  capable of creating unique assignments for college or university students all across the globe.Assignment Help is a term which is best for students help, they can easily get help for their online assignment help.Provide best all Assignment Help to the student at cheapest cost.

  2. Anonymous

    Try using header ("REFRESH: $delay;"); command in client.isAuthenticated(); parameters. If still, it does not give refresh token then you need a different server or newer version of visual studio. There can be some tutorials online where you can find your solution. For other programming assistance, you can go to Affordable Writing services and select your desired language. 



  3. Anonymous

    Get admission to the token is a credential that can be used by an application to get Paper Writing Help admission to an API. Get admission to tokens can be either an opaque string or a JSON internet token. They tell the API that the bearer of the token has been legal to get admission to the API and perform particular moves targeted through the scope that has been granted.

  4. Anonymous

    A high-standard post with all imperative information about Assignment Help UK services. Looking forward to availing the premium services.

  5. Anonymous

    Run is called to begin a WPF application. In the event that you characterize your Application using markup, or markup and code-behind, Run will be called certainly. However, in the event that you characterize your Pay Someone To Do My Assignment Application using the code, you should expressly call run.

  6. Anonymous

    Hello, every one i would like to ask some impotent issue my online store live in wordpress platform problem is it, every day show this massge.

    "The following plugins have new versions available. Check the ones you want to update and then click “Update Plugins" but i am not developer before i had click update the my website page collapse then i had pay for developer he was fixed all problem now what should i do please give a best idea i will resolve this issue. 

Write a comment…