trash nothing
  1. users
trash nothing
  • messages
    • List conversations
      GET
    • Mark all conversations as read
      PUT
    • Search conversations
      GET
    • Delete conversation
      DELETE
    • Archive conversation
      PUT
    • Block conversation
      PUT
    • Mark conversation as read
      PUT
    • List conversation messages
      GET
    • Reply to conversation
      POST
    • Report conversation
      POST
    • Unarchive conversation
      PUT
    • Unblock conversation
      PUT
  • misc
    • Send feedback
  • groups
    • Search groups
    • Retrieve multiple groups
    • Join groups
    • Retrieve a group
    • Submit group answers
    • Contact group moderators
    • Leave a group
  • photos
    • Create a photo
    • Retrieve multiple photos
    • Delete a photo
    • Rotate a photo
  • posts
    • List posts
    • Submit a post
    • List all posts
    • List all post changes
    • Retrieve client.js
    • Retrieve multiple posts
    • Search posts
    • Retrieve a post
    • Update a post
    • Delete a post bookmark
    • Bookmark a post
    • Retrieve post display data
    • Flag a post
    • Map a post
    • Promise an offer post
    • Reply to a post
    • Satisfy a post
    • Share a post
    • Unpromise an offer post
    • Withdraw a post
  • stories
    • List stories
    • Submit a story
    • Retrieve a story
    • Like a story
    • Unlike a story
    • Record story viewed
  • users
    • Retrieve current user
      GET
    • Update current user
      PUT
    • List current users' email alerts
      GET
    • Create an email alert
      PUT
    • Delete an email alert
      DELETE
    • Change email address
      POST
    • Set users' email address as not bouncing
      PUT
    • List current users' groups
      GET
    • Update location
      PUT
    • List current users' group notices
      GET
    • List current users' post locations
      GET
    • Save a post location for the current user
      PUT
    • List current users' posts
      GET
    • Search current users' posts
      GET
    • Set a profile image
      POST
    • List current users' profile images
      GET
    • Resend account verification email
      POST
    • Send password reset email
      POST
    • Report a user
      POST
    • Retrieve a user
      GET
    • Retrieve user display info
      GET
    • Submit feedback on a user
      POST
    • List posts by a user
      GET
    • Search posts by a user
      GET
    • Retrieve a users' profile image
      GET
  1. users

Set a profile image

POST
/users/me/profile-image
users
Profile images must be at least 90 pixels wide and tall. And if the image used is not square it will be automatically cropped to be square.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://trashnothing.com/api/v1.2/users/me/profile-image'
Response Response Example
200 - Example 1
{
    "photo": {
        "photo_id": "987-423",
        "thumbnail": {
            "height": 120,
            "url": "https://trashnothing.com/img/2018-02-02/307731-20180119_155358.90x120.jpg",
            "width": 90
        }
    },
    "user": {
        "about_me": "I used to be an accountant but then I decided to become a pirate.",
        "country": "US",
        "digest": "6_hours",
        "digest_photos": false,
        "email": {
            "address": "johndoe@example.com",
            "bouncing": false,
            "spam_stop": false,
            "verified": true
        },
        "firstname": "Jack",
        "has_password": false,
        "last_listings_view": "2018-02-15T15:04:47",
        "lastname": "Carter",
        "location": {
            "latitude": 39.766098,
            "longitude": -105.077206,
            "name": "Wheat Ridge, CO, USA",
            "radius'": 32186.88
        },
        "member_since": "2009-09-25T14:20:01",
        "post_location": {
            "latitude": 39.766098,
            "longitude": -105.077206,
            "name": "Wheat Ridge"
        },
        "post_reminders": true,
        "profile_image": "https://gravatar.com/avatar/88305a95b05b30f6cd306019ea5d88f3?s=90&r=pg&default=identicon",
        "profile_image_source": "gravatar",
        "public_name": false,
        "public_post_sources": [
            "trashnothing"
        ],
        "show_all_group_posts": true,
        "signup": "2017-11-20T04:32:06",
        "special_notices": true,
        "user_id": 119458,
        "username": "captainjack",
        "uses_fair_offer_policy": true,
        "verified": true
    }
}

Request

Body Params multipart/form-data
crop
string 
optional
If the photo needs to be cropped, a JSON encoded object with the crop arguments can be passed. The supported crop arguments are below. All arguments except rotate are required.

- original_width: Original width of the photo before being cropped or rotated (in pixels).
- original_height: Original height of the photo before being cropped or rotated (in pixels).
- x: The x-coordinate of the top left corner of the cropped area.
- y: The y-coordinate of the top left corner of the cropped area.
- size: The size of the square cropped area.
- rotate: (optional) The number of degrees to rotate the image before cropping.
Currently only 90, 180 and 270 are supported which correspond to rotate left, rotate upside down and rotate right.

device_pixel_ratio
string 
optional
Client device pixel ratio used to determine thumbnail size (default 1.0).
Example:
1
photo
file 
optional
Photo to upload.
photo_id
string 
optional
Photo to use (if already uploaded).
set_default
string 
optional
Whether or not to set the photo as the users' default profile image. Set to 1 to enable and 0 to disable.
Example:
1

Responses

🟢200The updated user and the photo.
application/json
Body
photo
object (PhotoResult) 
optional
The result of uploading or editing a photo.
Example:
{"photo_id":"987-423","thumbnail":{"height":120,"url":"https://trashnothing.com/img/2018-02-02/307731-20180119_155358.90x120.jpg","width":90}}
photo_id
string 
optional
thumbnail
object 
optional
Photo thumbnail data.
user
object (CurrentUser) 
optional
Example:
null
about_me
string 
optional
A short bio a user has written about themselves to help other members get to know them better. May be null if the user has not written anything about themselves.
country
string 
optional
A 2 letter country code for the country that has been automatically detected for the user (see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 ). May be null if no country has been set.
feedback
object 
optional
firstname
string 
optional
The first name of the user (may be null).
lastname
string 
optional
The last name of the user (may be null).
member_since
string 
optional
The date and time when the user first became publicly active on a group (the date may be older than when the user signed up).
profile_image
string 
optional
A URL to a profile image for the user. Profile images sizes vary based on the source (Google, Facebook, Gravatar, etc) and some can be as small as 64px by 64px. Will be null for api key requests and requests where the oauth user doesn't belong to any of the same groups as this user.
reply_time
integer 
optional
An estimate of how many seconds it takes this user to reply to messages. May be null when there is not enough data to calculate an estimate.
user_id
string 
optional
username
string 
optional
A username that can be displayed for the user (the username is NOT guaranteed to be unique). Will be null for api key requests and requests where the oauth user doesn't belong to any of the same groups as this user.
digest
string 
optional
If digest emails are enabled, this is the frequency of digest emails sent to this user. One of: weekly, twice_weekly, daily, 12_hours, 8_hours, 6_hours, 4_hours, 2_hours, hourly

If digest emails are disabled, this will be null.
digest_photos
boolean 
optional
Whether or not photos are included in the digest emails sent to the user.
email
object 
optional
Data related to the users' email address.
has_password
boolean 
optional
Whether or not the user has a password (accounts created using 3rd party providers like Facebook don't have passwords set).

When has_password is false, the only way to set a password on the users' account is to send the user a password reset email.
last_listings_view
string <date-time>
optional
The UTC date and time when the user last viewed the newest posts on the All Posts page (may be null).

NOTE: For this to be accurate, clients must update the last_listings_view property of the current user every time the user is shown the newest posts on the All Posts page.
location
object 
optional
The users' location. The location is used to determine which posts are shown to the user (may be null).
post_location
object 
optional
Location data used by the user the last time they posted.
post_reminders
boolean 
optional
Whether or not post reminders are enabled for this user (to remind them to update or repost their posts).
profile_image_source
string 
optional
The source of the users' profile image. One of: gravatar, facebook, google, freegle, custom
public_name
boolean 
optional
Whether or not the user has chosen to make their first and last name public.
public_post_sources
array[string]
optional
A list of the public post sources the user is interested in seeing posts from (currently only 'trashnothing' is supported). If the array is empty, no sources are enabled and the user will only see posts from the groups they are a member of.

NOTE: Additional sources may be added in the future so clients should take care to support arbitrary sources being returned.
show_all_group_posts
boolean 
optional
If true, all group posts from the users' groups are shown to them on the main posts page and in the digest emails.

If false, only group posts in the area defined by the users' location are shown.
signup
string <date-time>
optional
The UTC date and time when the user signed up.
special_notices
boolean 
optional
Whether or not the user wants to receive special notice emails from the groups they are a member of. Special notices are admin posts that the group moderators choose to send out by email.
uses_fair_offer_policy
boolean 
optional
Whether or not the user used the Fair Offer Policy (see https://trashnothing.com/fair_offer_policy ) the last time they posted.
verified
boolean 
optional
Whether or not the user has verified their account. The user account will be limited (eg. they will not be able to reply to posts) until their account is verified.
🟠400Missing or invalid parameters.
Modified at 2022-09-11 18:59:48
Previous
Search current users' posts
Next
List current users' profile images
Built with