AnsweredAssumed Answered

Uploading files to a user's profile

Question asked by William Lehnertz on Mar 30, 2017
Latest reply on Apr 2, 2017 by William Lehnertz

Has anyone successfully uploaded a file to another user's profile?

 

I"m trying to upload each user's ID card picture to their profile, but I've hit some snags. When I push to /api/v1/users/self/files where is the file going to exactly?

According to the API

Passing a user_id of self is an easy shortcut to specify the current user.

How do I know what the current user is when using the URL above? My guess is its uploaded to the user who owns the API key, but I wasn't the who created the key, so I don't know where our key was created from.

 

Some notes:

* I'm uploading using an URL. We're a Banner school and the pictures are hosted in Banner as blobs.

* If I try to upload to a user's URL (/api/v1/users/<user_id>/files) I get a permission error. Even using my user's ID.

* I'm using a modified version of this script. 

I don't want 3000 images hanging out in some user's profile or in some random S3 repo somewhere. Each user should have their profile picture in their file storage.

 

I should mention, I'm using curl for testing. I have not actually run my script. I want to make sure all my API calls are good. Thinking about this more, it would seem the API is meant for internal use. Where self would be the authenticated user, which in this case would be my API key.  Perhaps, this can't be done the way I want.

Outcomes