Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

API not working from Postman

Avatar

Level 5

I have an API (POST) and I am getting the below response from Postman. What can be the issue?

 

<html>

<head>
    <title>Content modified /content/spartacus-endpoint/getNavigationData</title>
</head>

<body>
    <h1>Content modified /content/spartacus-endpoint/getNavigationData</h1>
    <table>
        <tbody>
            <tr>
                <td>Status</td>
                <td>
                    <div id="Status">200</div>
                </td>
            </tr>
            <tr>
                <td>Message</td>
                <td>
                    <div id="Message">OK</div>
                </td>
            </tr>
            <tr>
                <td>Location</td>
                <td><a href="/content/spartacus-endpoint/getNavigationData"
                        id="Location">/content/spartacus-endpoint/getNavigationData</a></td>
            </tr>
            <tr>
                <td>Parent Location</td>
                <td><a href="/content/spartacus-endpoint" id="ParentLocation">/content/spartacus-endpoint</a></td>
            </tr>
            <tr>
                <td>Path</td>
                <td>
                    <div id="Path">/content/spartacus-endpoint/getNavigationData</div>
                </td>
            </tr>
            <tr>
                <td>Referer</td>
                <td>
                    <div id="Referer"></div>
                </td>
            </tr>
            <tr>
                <td>ChangeLog</td>
                <td>
                    <div id="ChangeLog">&lt;pre&gt;&lt;/pre&gt;</div>
                </td>
            </tr>
        </tbody>
    </table>
    <p><a href="/content/spartacus-endpoint/getNavigationData">Modified Resource</a></p>
    <p><a href="/content/spartacus-endpoint">Parent of Modified Resource</a></p>
</body>

</html>
8 Replies

Avatar

Community Advisor

Hello @goyalkritika 

 

Can you possibly share the Request that you sending from postman?


Aanchal Sikka

Avatar

Community Advisor

Hello @goyalkritika 

 

Are you sure the URL used is correct?

A URL "/content/spartacus-endpoint/getNavigationData" seems more like a content to be created in AEM. It doesn't seem like a Servlet URL accepting POST request. 


Aanchal Sikka

Avatar

Level 5

It is a resource type servlet and /content/... is the endpoint. It is correct only.

Avatar

Community Advisor

@goyalkritika 

 

Can you please try by configuring a proper selector/extension as well?


Aanchal Sikka

Avatar

Community Advisor

Hi @goyalkritika 

 

Can I know what is the purpose of the API ? are you using any service user to write or create data on jcr ?

 

If yes, Please check the permissions of that service user

Avatar

Community Advisor

Hi @goyalkritika 
Are you trying in Author or Publish?

Can you share how do you hit API from postman and from browser?



Arun Patidar

Avatar

Administrator

@goyalkritika Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni