Trigger Scrapy API

Hello,

Looking to trigger the scrapy cloud API run method. https://doc.scrapinghub.com/api/jobs.html#run-json

I can auth ok by including url token param.

When triggering I get bad request from API, missing project argument. I have tried including this as a JSON body param but no luck.

Am I going wrong somewhere or is there a conflict that won’t allow me to do this that I’m not aware of?

Thanks!

Update:

Getting the following…

"You are seeing this message because this HTTPS site requires a ‘Referer header’ to be sent by your Web browser, but none was sent.
This header is required for security reasons, to ensure that your browser is not being hijacked by third parties.

If you have configured your browser to disable ‘Referer’ headers, please re-enable them, at least for this site, or for HTTPS connections, or for ‘same-origin’ requests."

Had a search but no idea on this one…

Seems like it cant be done currently. I thought you could use the bubble API connector to do this very thing but appears I cant send what the basic formats and data that Scrapy API needs. There isn’t much resource at all on the web (most likely because hardcoding these Curl requests are none problematic). Just met with a closed door security wise even though Scrapy acknowledges the Token. 8 hours deep. :frowning:

@Jici I noticed you replied but then retracted. I have been at this for over a day and I don’t think the Bubble API Connector is able to interact with it. I have posted over in the Scrapy forum but no response. To me, I cant understand how it isn’t possible. Literally just a POST call authenticated with some parameters but I get incorrect media types, then straight up security says no, then no headers. Wild goose chase it appears.

Resolved. Needed to set content-type as application/x-www-form-urlencoded pass json in different format. None of this was in documentation. Answer was over at Scrapy Forum. Postman confirmed it.

Yes I see your post on Scrapy
I’ve retracted because some of endpoint was working but some other not and got the same issue.
You are right for the header. Didn’t think to check that because the return was a “security” reason but it make sense. I’ve write a topic about strange behavior of API Connector for header.

1 Like