Discuss Scratch

Sneaky_Snake10
Scratcher
30 posts

Integrations in Scratch?

So I am trying to make an integration into my application using Scratch. I set up a webhook and an application which catches API calls to that IP for debugging. When manually making the call using a socket, and using urllib.requests in Python, it seems to work. I need to call the API from scratch and transmit some data. For testing purposes, I have a Discord webhook set up to see if it works. How would one go about making an API call in Scratch?(.sb3 files are fine)

Edit: BTW extensions are also fine, I just need a reliable project that can send data to an API.

Last edited by Sneaky_Snake10 (April 12, 2023 21:07:59)

ajskateboarder
Scratcher
1000+ posts

Integrations in Scratch?

_nix wrote extensive documentation on the API
You can find it here
Jeffalo
Scratcher
1000+ posts

Integrations in Scratch?

ajskateboarder wrote:

_nix wrote extensive documentation on the API
You can find it here
that's if you want to write code that interacts with the scratch platform (users, comments, etc.)

if you want to have a scratch project make http requests to an external api, you have some options. if you want the project to be accessible on scratch.mit.edu, you have to run a server (eg. in python or nodejs) that listens for updates to cloud variables and makes the http request for users. this is really hacky but theres no other way to make a scratch project on scratch.mit.edu talk to the outside world.

there are some extensions, such as turbowarp which have functionality to make http requests. for example there is an extension within Turbowarp called Utilities, which adds blocks to make GET http requests.



for more advanced requests, there is a network extension accessible from the turbowarp library.

Sneaky_Snake10
Scratcher
30 posts

Integrations in Scratch?

Thanks!

Last edited by Sneaky_Snake10 (April 14, 2023 19:28:45)

Powered by DjangoBB