Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » Integrations in 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.
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)
- Jeffalo
-
Scratcher
1000+ posts
Integrations in Scratch?
_nix wrote extensive documentation on the APIthat's if you want to write code that interacts with the scratch platform (users, comments, etc.)
You can find it here
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)
- Discussion Forums
- » Advanced Topics
-
» Integrations in Scratch?