Secret vault REST API usage

Hello,
I try to connect to secret vaults via REST api, but i have 401 error maybe someone know what i’m doing wrong
Code exmaple:

<?xml version="1.0" encoding="UTF-8"?>
    <config xmlns="http://web-harvest.sourceforge.net/schema/1.0/config" scriptlang="groovy">

        <script><![CDATA[
    		def post = new URL("http://localhost:15280/workfusion/api/v1/secret-vault/entry").openConnection();
    		String urlParameters  = "alias=s3_alias";
    		String userCredentials = "username:password";
    		String basicAuth = "Basic " + new String(Base64.getEncoder().encode(userCredentials.getBytes()));
    		post.setRequestMethod("POST")
    		post.setRequestProperty ("Authorization", basicAuth);
    		post.setDoOutput(true)
    		post.setRequestProperty("Content-Type", "application/x-www-form-urlencoded")
    		post.getOutputStream().write(urlParameters.getBytes("UTF-8"));
    		def postRC = post.getResponseCode();
    		log.info(postRC.toString())
        ]]></script>

        <export include-original-data="true"></export>

    </config>

Hi @omishchenko.
Is this code related to some assignment in Automation Academy?

Hello @Lera
No, this related with WF API issue

Thanks. We don’t provide any support of this functionality in RPA Express. It may work as expected, but we cannot advise regarding any fix or functionality.

@Lera
So you wonna tell, that WF doesn’t support this feature at all??
Am I right? Or maybe you have any another department that support this WF feature?

REST API should work in our Enterprise product (former SPA). In any questions related to Enterpise Edition, you should submit to another category - Intelligent Automation Cloud Enterprise.

@Lera
Create new one in according category. Maybe you need to create more clarify description to your categories, coz I create topic in community category and now you say that it’s incorrect…

@omishchenko check the username and password you use in the script. 401 means you are unauthorized to access the url.

@ashapkina
Thanks, I know what means 401 error.
I can easily login to CT with same username and password, so it’s valid value.
This endpoint should work fine with username/password
https://kb.workfusion.com/display/WF/Secrets+Vault+API

@ashapkina
Do you have any other solution/suggestion? Coz credentials are valid

@omishchenko we managed to reproduce this issue in the Studio. Could you create a ticket for our SPA support team in the service desk so they look into it? You should have access to it here: https://jira.workfusion.com/servicedesk/customer/portals

@ashapkina
Unfortunately, “create a request” doesn’t work too, after click on it just close popup window. I have a video to confirm that. if need i upload it somewhere.