collect api error

2 0 0

url :

method : post

body :

"collect": {
"product_id": 6728401748166,
"collection_id": 270312571078
response :


<script type="text/javascript" defer>
window.location = "https:\/\/\/oauth\/authorize?client_id=7ee65a63608843c577db8b23c4d7316ea0a01bd2f7594f8a9c06ea668c1b775c\u0026destination_uuid=ad5df46b-a54c-44c5-a9a4-1d54fd24876c\u0026nonce=e80513925f404899a5db1b75d104d61b\u0026prompt=merge\\u0026response_type=code\\u0026state=a39072febeb025a44a3c2a135b1db7dd\u0026ui_locales=en\u0026ux=shop%20new_design_language";


I wrote some APIs according to the sample, but the html source is returned.

Why is that?

I don't know the information even if I go into that link.

Reply 1 (1)

Not applicable

Hi @nisystem 

Aibek is here from

Maybe this can help you: 

You have received a response from shopify that you are not authorized to make API requests.

If you send post requests from the browser, then try to open any request to the Shopify API in a new tab, and you will open a window for authorization. After completing the login, the session will be saved in the cookies of your browser, and you will then be able to make requests to the API.

If you are trying to make requests from outside (not from the browser), then you need to get an access token. For more information on how to get it, you can see the link: 

Hope that helps you.