Submit a post
POST
/posts
posts
NOTE: An alternate way to submit posts that does quicker client side validation is to use the script served by the API at the /posts/client.js endpoint (see the description of the /posts/client.js endpoint for usage instructions).
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://trashnothing.com/api/v1.2/posts' \
--form 'location=""' \
--form 'session=""' \
--form 'title=""' \
--form 'type=""'
Response Response Example
200 - Example 1
{
"identifier": "string",
"message": "string",
"preference_key": "string",
"result": "string",
"session": {
"property1": "string",
"property2": "string"
}
}
Request
Body Params multipart/form-data
content
string
optional
expires_in
string
optional
Note that posts may not appear instantly after submission because the volunteer moderators of many groups may have additional automatic or manual review processes in place that can cause delays. So with short expirations (eg. < 8 hours), there is a chance that the post may expire before it's approved and so it will never be published.
fair_offer
string
optional
group_ids
string
optional
latitude
string
optional
If latitude and longitude are not provided, an attempt will be made to automatically geocode the location. If the location is unable to be geocoded, the post will be rejected* and will have to be resubmitted with a latitude and longitude corresponding to the location or resubmitted with a different location that can be automatically geocoded.
NOTE: The latitude and longitude should NOT be the users' exact location because we don't want to publicize their exact location unless their location description is their full address (which is not recommended).
*When a post is rejected because it can't be geocoded, the returned error will have its identifier property set to 'unknown-location'.
location
string
required
longitude
string
optional
photo_ids
string
optional
preferences
string
optional
session
string
required
title
string
required
type
string
required
Responses
Modified at 2022-09-11 18:59:48