Jump to content
Fabian Näf

API Create Folder with Guide

Recommended Posts

Hi There

 

I just wanted to ask, if it would be possible to extend the API and to give the ability to specify the "Guide", when creating a new Folder?

Currently, this doen't seams to be possible.

 

Here's my code (Powershell):




        $Body = @{



            FolderName = $Name



            Description = $Description



            CopyPermissionsFromPasswordListID = ""



            CopyPermissionsFromTemplateID = 1



            NestUnderFolderID = $ParentFolderID



            Guide = "test"



            APIKey = $PasswordStateSystemWideAPIKey



        }



        $jsonBody = $Body | ConvertTo-Json



        $PasswordstateURL = "$($PasswordstateURL)/api/folders"



        $result = Invoke-Restmethod -Method POST -Uri $PasswordstateURL -ContentType "application/json; charset=utf-8" -Body $jsonBody

This is creating a new folder, but the guide is empty.

 

Another suggestion for the API-Documentation:

  1. Because of the special-characters like ä ö ü in our language, I had to add "charset=utf-8" to the ContentType
  2. I had problems to escape special characters in the JSON, when I did it the way as described in the API-documentation. So I came up with this solution: First I create a Powershell-Object and then I convert it to JSON. This automatically escaps all special characters.

 

Best regards,

 

Fabian

Share this post


Link to post
Share on other sites

Hi Fabian,

You're correct in that it's not currently possible to specify the guide - this is mainly because Guides generally can have a lot of formatting in them, including HTML tags and many lines, which would be difficult to achieve in the json string.

 

Could you share an example of the PowerShell-Object you created, and we'll see if there's anything we can do once version 8 is complete.

Regards

Click Studios

Share this post


Link to post
Share on other sites

Hi

 

The Powershell-Object is already in my code example:

 


$Body = @{

           FolderName = $Name

           Description = $Description

           CopyPermissionsFromPasswordListID = ""

           CopyPermissionsFromTemplateID = 1

           NestUnderFolderID = $ParentFolderID

           Guide = "test"

           APIKey = $PasswordStateSystemWideAPIKey

}

$jsonBody = $Body | ConvertTo-Json

 

Best regards,

Fabian

Share this post


Link to post
Share on other sites

You said, setting the guide-field per API is mainly, because it's a HTML-field.

When I add a password to a passwordlist, I'm able to set the note-filed, which is very similar to the guid. It's a HTML-field as well.

Share this post


Link to post
Share on other sites

No worrys :-)

Thanks a lot for your work, I really appreciate your support! 

 

About my featurerequest:

I would like to extend my feature request. As I just tested, I was also not able to specify a guide on a passwordlist. 

 

Summary: It would be great, if I could specify Guides for Folders and for PasswordLists :)

 

 

Share this post


Link to post
Share on other sites

It's me again (I hope, I'm not annoying you :huh:)...

 

Another thing for this API-Feature Request:

It would be great, if I also could specify an image when creating a passwordlist.

 

Feature Request Summary:

  • Specify Guide when creating a Folders
  • Specify Guide when creating a Passwordlist
  • Specify Image when creating a Passwordlist
  • Setting Permissions on Password-Level

 

Best regards,

 

Fabian

Share this post


Link to post
Share on other sites

Thanks Fabian - we'll look into this for you at the same time as your other requests.

 

Regards

Click Studios

Share this post


Link to post
Share on other sites

Hi Fabian,

Today we've released Build 7883, which includes these three requests that you had:

  • Specify Guide when creating a Folders
  • Specify Guide when creating a Passwordlist
  • Specify Image when creating a Passwordlist

We weren't able to include the "Setting Permissions on Password-Level" feature in this build sorry:(  All information on how to use these new settings are documented under Help -> Web API Documentation, after you perform an upgrade.

 

Hope this helps!

 

Regards,

Click Studios
 

Share this post


Link to post
Share on other sites

Hi

 

I just tested all three new API-features. All of them are working great! I'm really happy, excellent work!

It's really impressive how fast you guys are working. I've never experienced any company that's so responsive to their customers!

 

Best regards,

 

Fabian

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×