How to Configure & Test REST API in Kentico 12 using Postman

Mr. Arif asked on December 4, 2024 03:42

Hi All,

I have tried to configure the REST API for Kentico 12 for IIS using this guideline: configure the REST service. All steps have been followed except for the upload large data.

When I try to test some API in Postman using this API URL (https://mywebsite.com/rest/content/currentsite/en-us/all/news?format=json) and try on other as well, it return status code 200 but it return Login Page instead of JSON data. I assume this is because the URL is treated as Page instead of API url.

I also try to use hash authentication, but it still return as Login page, not JSON. I have also enable the REST setting following this guideline. So, my questions are:

  1. Why the API url return as Login page in Postman?
  2. Is there any missing steps when configuring the REST api?

Thank you.

Recent Answers


Juraj Ondrus answered on December 5, 2024 06:01

Do you have any authentication set in the IIS/server level? What is the user account like you are using for the basic authentication? Is it editor/administrator/global admin privilege level?

0 votesVote for this answer Mark as a Correct answer

Mr. Arif answered on December 5, 2024 07:08

Yes, I have authentication set in the IIS/server level, which is Forms Authentication and Anonymous Authentication that is set to enabled, similar as shown in the guidelines. I am also using global administrator privilege for basic authentication.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on December 5, 2024 07:51

So, isn't the IIS level authentication blocking this? What are your settings? You need to ensure that the /rest endpoint is accessible.

0 votesVote for this answer Mark as a Correct answer

Mr. Arif answered on December 5, 2024 10:19

Hi Juraj,

Thank you for your reply.

May I know how to ensure the rest endpoint is accessible? How to check / troubleshoot it?

My REST settings in Kentico (Settings -> Integration -> REST) is I set to true for 'Service Enabled' and I set 'Service Enabled For' to Both. For other settings, I leave it as false (unchecked).

My I know, how can IIS level authentication still blocking the REST endpoint? Even I already set the basic authentication in postman with the username and password. I even use the generate an authentication hash for the REST URL, but still return login page.

All the authentication in IIS, I already follow / configure based on the guidelines provided (without the Windows & Digest Authentication).

Thank you.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on December 5, 2024 10:22

I do not know your IIS setup - you may want to check whether there is set something before Kentico app which may require login. For the other settings, related to Kentico app, please see the documentation I linked. I am unable to reproduce the issue so I assume it is something on your IIS which is blocking the request and requiring log in. It would be good to check what kind of logon page it is.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.