Skip to main content

Hi, I am a beginner in Box development.

I need to get familiar with Box API, so I started with 'curl' method for learning.

I am trying to execute a curl command 'shared item', but unfortunately I am unable to set the header (parameters) correctly. Please let me know, what does Box Api header means. If you can give me a sample input for its execution, I will be very thankful.

Following is the shared link I have:

https://app.box.com/s/vrvaf2wxdiwf11bup5w0bb5w08ihenz3/1/***number removed for privacy***3

P.s. I did some research online to find solution to my problem, but remained unsuccessful in getting any response.

Thanks.


The curl example for that endpoint is this:


 


curl https://api.box.com/2.0/shared_items
-H "Authorization: Bearer ACCESS_CODE"
-H "BoxApi: shared_link=SHARED_LINK"

 


So for you, the call would be


 


curl https://api.box.com/2.0/shared_items
-H "Authorization: Bearer ACCESS_CODE"
-H "BoxApi: shared_link=https://app.box.com/s/vrvaf2wxdiwf11bup5w0bb5w08ihenz3/1/***number removed for privacy***3"

 


You might need to URL-encode the shared link value, but I'm not sure.


 


If the shared link has a password, then you'd need to do


 


curl https://api.box.com/2.0/shared_items
-H "Authorization: Bearer ACCESS_CODE"
-H "BoxApi: shared_link=SHARED_LINK&shared_link_password=SHARED_LINK_PASSWORD"


Hi, thank you for your reply.

Can you please tell me what argument should I pass to the "BoxApi" (string) parameter to test this feature on "try it" (as can be seen in the screenshot) on Box API reference?

I want to test some features on this tool, before I can develop my app, since it's beneficial in learning different references of Box API.

BOX_9iym2kaxp7k6l8mjxy4yiing0j91i48n.png

 

 

Thanks.



I just tried it, and it looks like that endpoint isn't quite working as intended. I filed a bug for it to be fixed.


 


In the meantime, you should be able to get it to work by typing shared_link=YOUR_SHARED_LINK into the value for BoxApi, and leaving the other fields blank.



I'm bumping into this problem as well.

 did you manage to have any answer to your ticket?

 

Thank you!



 and , we recently updated the docs for how to access shared items via the API.  Please let me know if this provides the information you were looking for: https://docs.box.com/reference#get-a-shared-item



Reply