File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44# Get access token
55# https://www.deviantart.com/developers/authentication
6+
67$Body = @ {
78 grant_type = " client_credentials"
89 client_id = $env: DEVIANTART_CLIENT_ID
@@ -11,6 +12,7 @@ $Body = @{
1112$Parameters = @ {
1213 Uri = " https://www.deviantart.com/oauth2/token"
1314 Body = $Body
15+ Method = " Post"
1416 Verbose = $true
1517 UseBasicParsing = $true
1618}
@@ -19,12 +21,12 @@ $Response = Invoke-RestMethod @Parameters
1921# Get download URL
2022# https://www.deviantart.com/developers/http/v1/20240701/deviation_download/bed6982b88949bdb08b52cd6763fcafd
2123# UUID is 8A8DC033-242C-DD2E-EDB0-CC864772D5F4
22- $Body = @ {
23- access_token = $ Response.access_token
24+ $Headers = @ {
25+ Authorization = " Bearer $ ( $ Response.access_token ) "
2426}
2527$Parameters = @ {
2628 Uri = " https://www.deviantart.com/api/v1/oauth2/deviation/download/8A8DC033-242C-DD2E-EDB0-CC864772D5F4"
27- Body = $Body
29+ Headers = $Headers
2830 Verbose = $true
2931 UseBasicParsing = $true
3032}
You can’t perform that action at this time.
0 commit comments