新しいBoxサポートサイトへようこそ。 変更点の詳細はこちらをご確認ください .

How to associate Metadata to Document / folder using JDK API

回答済み
新規投稿

コメント

3件のコメント

  • Mitesh4Box

    Java docs API says to use followng method, I am trying to use the same getting 404 error. 

     

    Anyone tried this ?

     

    public Metadata createMetadata(String typeName, Metadata metadata)

    0
    コメントアクション パーマリンク
  • kendomen

    I tried something simple and it seems to work.

     

    public static void main(String[] args) {
            BoxAPIConnection api = new BoxAPIConnection(DEVELOPER_TOKEN);
    
            BoxFile file = new BoxFile(api, "removed for privacy33");
            file.createMetadata(new Metadata().add("/foo", "bar"));
    
            Metadata metadata = file.getMetadata();
            System.out.println("printing out meta-data: " + metadata.get("/foo"));
    }

    Here's my output:


    printing out meta-data: bar

    Process finished with exit code 0

    0
    コメントアクション パーマリンク
  • veemini

    Hi Kendomen,

      I created Metadata the same way you described, but while searching  for the key, I'm not getting any results. 

     

    Thanks,

    Veemini.

    0
    コメントアクション パーマリンク

サインインしてコメントを残してください。