Skip to main content

About API /recent_items

  • April 17, 2024
  • 2 replies
  • 124 views

I want to call [API:2.0/recent_items] by postman.
but error 403 is populated.
used token is ok. because I used the token to called [API: 2.0/files/id ] and successful response.
when use same the token to call [API:2.0/recent_items] ,it is error 403.
how to solve it ?
thanks.

2 replies

rbarbosa Box
Forum|alt.badge.img
  • Developer Advocate
  • 556 replies
  • April 17, 2024

Hi @user233 , welcome to the forum!

That is odd, and you are not providing much information to help diagnose the issue.

I can duplicate this by trying to guess, so here it goes.

The recent end point will only work if it has a user security context, as opposed to a service account, because only users have recent entries.

Consider an application setup as CCG, and using the enterprise id:

curl --location 'https://api.box.com/2.0/recent_items' \
--header 'Authorization: Bearer VK...JD' 

I get a 403.

The same application using a user:

curl --location 'https://api.box.com/2.0/recent_items' \
--header 'Authorization: Bearer lg...JW' 

Returns:

{
    "next_marker": "",
    "limit": 100,
    "order": {
        "by": "interacted_at",
        "direction": "DESC"
    },
    "entries": [...many entries...]
}

Let us know if this helps


  • Author
  • New Participant
  • 3 replies
  • April 18, 2024

thanks a lot . you are right.