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

Attempting to update file info returns "invalid parameter" item error

回答済み
新規投稿

コメント

5件のコメント

  • cbetta

     my gut feeling is you are getting this because you aren't authenticated as a user that has access to that file. You could get the current user for the token/client you have (`/users/me`) and see if this is a user that indeed has access to that file.

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

    They're a test file and folder that are created in the line above with the same (only) access token. Any other idea? It can also be deleted again by this token the lines beneath it, given the same id so it appears to be a valid file id that I have access to.

     

    Here's what postman echoes back to my PUT request:

     

    {
        "args": {
            "fields":"parent"
        },
        "data": {
            "parent": {
                "id":"***number removed for privacy***98"
            }
        },
        "files": {},
        "form": {},
        "headers": {
            "x-forwarded-proto": "https",
            "host": "postman-echo.com",
            "content-length": "31",
            "accept": "application/json",
            "authorization": "Bearer JrUalrqUxWB47Pb72dVA50SmEIATxDtA",
            "content-type": "application/json",
            "user-agent": "GuzzleHttp/6.3.3 curl/7.51.0 PHP/7.1.1",
            "x-forwarded-port": "443"
        },
        "json": {
            "parent": {
                "id": "***number removed for privacy***98"
            }
        },
        "url":"https://postman-echo.com/put?fields=parent"
    }

    And this is what Postman echoes to the Box Content API "Move a File" postman collection request:

     

    {
    
        "args": {},
        "data": "{\"parent\": {\"id\" : ***number removed for privacy***98}}",
    
        "files": {},
    
        "form": {},
    
        "headers": {
    
            "x-forwarded-proto": "https",
    
            "host": "postman-echo.com",
    
            "content-length": "34",
    
            "accept": "*/*",
    
            "accept-encoding": "gzip, deflate",
    
            "authorization": "Bearer JrUalrqUxWB47Pb72dVA50SmEIATxDtA",
    
            "cache-control": "no-cache",
    
            "content-type": "text/plain",
    
            "postman-token": "f85cf6c0-462a-41cc-b237-ae647809b577",
    
            "user-agent": "PostmanRuntime/7.4.0",
    
            "x-forwarded-port": "443"
    
        },
    
        "json": null,
    
        "url": "https://postman-echo.com/put"
    
    }
    0
    コメントアクション パーマリンク
  • RobinDeSchepper

    Nevermind, while looking around in a function I use to make the request I discovered that the variables for both the id of the file to be moved and the id of the parent folder were the same resulting in me giving folder X, parent folder X, trying to move a folder inside itself.

     

    The error that I got back could be improved I think, seems like internal stuff reported back to me.

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

    100% something I agree on, and totally a thing I'm working on!

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

    Thanks @cbetta. For me it was not working because it was not assigned to that user.

    One more question is,
    So can we do access our folder to specific user, that specific user can use(I mean upload/download).

    Also if I share access_token with any of the user that can use my box account?

     

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

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