Can I call Private Stackscripts using the API?
Hello!
Is it possible for users to use the api to call my private stackscript if I grant access through oauth2?
1 Reply
bbigger
Linode Staff
Hey there! Yes, it is indeed possible. Under the StackScripts portion of our APIv4 documentation, there is a note that states:
If the request is not authenticated, only public StackScripts are returned.
Accordingly, authenticating your request with your OAuth or APIv4 token will also return private StackScripts. You can then include an X-Filter header to only return private StackScripts and proceed from there. Here's an example call that will only return your private StackScripts:
curl "https://api.linode.com/v4/linode/stackscripts" \
-H "Authorization: Bearer $TOKEN" \
-H 'X-Filter: {"is_public": false}'
Note: I've edited the title of this post and added some tags to make it easier to find for others.