Part IV ➝ Accounts, organizations, organization membership and data upload #5
Labels
Documentation
Documentation for developers at Internet Development Studio
Internal
Articles meant for the team.
What will I know after finishing this?
We will be managing accounts that need access to our APIs and services, so I've built a simple system to start with. This system will extend easily if we decide to add "Sign in with Bluesky" in the future.
You will learn the following things:
If you have any questions, do not hesitate to ask!
How do I create an account?
Run the following CURL script in your terminal:
You'll get this as a response on success:
If this is a new account, you will receive an e-mail you have to verify within 30 minutes.
Be careful with how you use the key, based on your
level
you have access to different API methods. If you leak it, we'll have to delete your user.How do I create an organization?
If you are an admin at the Internet Development Studio Company, you can create an organization by following the instructions below. Otherwise, you should join yours by visiting https://users.garden.
An organization is required before you upload data. Data is organized by the organization it is part of. Organizations are based on the domain name of your e-mail. However, admin accounts can create organizations freely without this restriction.
Run the following CURL script in your terminal with your API key:
You'll get this as a response on success:
Afterwards, you need to add yourself as an administrator of the organization.
With a
user
accountorganization
You can now upload a file
How do I upload a file?
Uploading a file is a two part process. First have a file on your computer, you will also need to know its MIME type. If you don't know the MIME type it is easy to grab, here is a screenshot:
By using
file --mime 293144301-502ab1bc-0de4-414d-8b9c-f87225d48ddc.png
I was able to get the MIME type.Next, you can run the following CURL script in your terminal with your API key:
You'll get this as a response on success:
If you got here, all you need to do now is run this CURL script next with the
uploadURL
, you need to make sure theContent-Type
is correct here:And if you're successful, you can visit the
fileURL
upon success immediately.How do I see all of my uploads?
Based on who you are, you can run this CURL script:
And if successful you'll get a response like this
If you want to see the uploads for a specific domain, and you have admin access, run this CURL script:
And if successful you'll get a response like this
Thats it
And viola, you can see the rendered image below and now you can use it anywhere.
And now you know everything you need to use the API. Obviously you can integrate this into clients-side and server-side code and use
fetch
instead if you need to.The text was updated successfully, but these errors were encountered: