Closed phroiland closed 3 years ago
You cannot use that endpoint with client credentials. You need to make that call as an authenticated user.
That doesn't answer the question.
Submitting images is an endpoint that requires an OAuth2 Token from the Authorization Code Grant or Implicit Grant. It does not function with the client credentials grant as that grant is not user specific.
redirect_uri
is a required field. If you are using it within a mobile app, you can use an app URI scheme and it should work with that.
I would like to post images via script running locally with images I have...wait for it...locally.
No app, no webpage, no scraping.
How is not possible to use my client_id and client_secret to post my own images without a uri?
client_id
and client_secret
only identify an application. Not an actual user of the site, an application cannot own a deviation, only a user can.
You need to login with a user to be able to submit so that a deviation can be created.
In terms of a redirect URI, you could have your CLI tool run a mini web server to offer a localhost url to redirect to, and then that gets the token. https://github.com/dcarley/oauth2-cli is a good generic example of this approach.
I am the user.
Is this really that difficult to understand?
I shouldn't have to run a "mini web server".
The client credentials does not identify a single user so cannot be used to upload, a client is a general application at a higher level than a single user.
To identify a user and thus allow upload, we require an auth token that is user specific. We provide more information on these authorisation flows here: https://www.deviantart.com/developers/authentication.
Authorisation code grant and implicit grant allows access to the authorised user's account for upload, and so forth.
Client credentials only allows access to public data such as browsing etc.
This is a standard OAuth 2.0 authorisation setup, you can probably find a nice implementation of an OAuth2 library in your language of choice that handles this case.
Hope that helps.
How is this done without a redirect_uri?
It doesn't appear to work with: Using The Client Credentials Grant