How to access Object Entries via REST API without authentication

thumbnail
Jamie Sammons, modified 2 Years ago. New Member Posts: 18 Join Date: 8/3/22 Recent Posts

Good Morning,

 

I am using DXP 7.4. I created an Object and added some entries.

Now I want to access the Objects Entries via REST API without being logged in.

 

I can access the endpoint but it only delivers empty fields:

{
  "actions" : { },
  "facets" : [ ],
  "items" : [ ],
  "lastPage" : 1,
  "page" : 1,
  "pageSize" : 20,
  "totalCount" : 0
}

I tried creating a Service Access Policy but it did not seem to change anything.

How can I get the entries from the API without being authenticated?

Best Regards

Adrian

Jamie Sammons, modified 2 Years ago. New Member Posts: 5 Join Date: 8/17/22 Recent Posts

Hey Adrian, 

I tried creating a Service Access Policy but it did not seem to change anything.

A. You don't need to create a SAP because it already existsimage_1
 

How can I get the entries from the API without being authenticated?

A. You need to give VIEW permission for Guest role, unauthenticated users always have this role.Under the hood when we're requesting object entries it will check if the user has permission to VIEW that object entry otherwise that entry won't be displayed in the response.Request without VIEW permission: image_2 and image_3Request with VIEW permission:image_4 and image_5In this case I gave an individial permission for Guest users VIEW this object entry (43989)More about Role and Permissions

Thank you!