Retrieve client.js
GET
/posts/client.js
posts
some of the post validation checks can be done on the client side which will be faster.
of the file are generated dynamically based on the current user. The file may be cached on a per
user basis based on the HTTP cache headers that are returned when the file is requested (currently
the cache headers specify that the file should expire after one day).
It is useful for pinpointing why a group ID shows up in the restricted array so that users can be provided feedback
about the reason for the crossposting restriction (eg. a message like 'group A doesn't allow crossposting to group B').
posting to group 1, the returned object will be:
the following properties:
process for a single post. The first time submit_post is called with a post, session should
be a new empty object (eg. {}). The session object should be persisted until that post
is successfully submitted and then it can be discarded so that the next post will start
over with a new empty session object.
by the post submission process and user input. Some post warnings passed to the callback object
have a preference_key string property so that users can opt out of those warnings in the future.
To save this opt-out preference, set the property indicated by the preference_key in the preferences
object (eg. preferences[preference_key] = 1). The preferences object is only read by submit_post and
never modified - it is up to the client to initialize, modify and persist the preferences object.
one argument - an object with five properties {result, message, preference_key, identifier, session}.
The result property is a string that is one of: success, error, warning. The identifier property is
set for errors and warnings and will contain a string that represents the type of error or warning that
occurred.
appear instantly after submission because the moderators of many groups may have additional
automatic or manual review processes in place that can delay the publishing of a post.
will contain text describing the error.
message property will contain a string describing the warning. A warning result doesn't prevent a post from
being submitted, to continue the submission process after a warning result, just re-submit the post
(with the updated session object) to temporarily override that specific warning.
set in the preferences object by the client to opt out of that type of warning in the future (see the description
of the preferences parameter for more details).
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://trashnothing.com/api/v1.2/posts/client.js?group_ids=&access_token='
Response Response Example
200 - Example 1
{}
Request
Query Params
group_ids
stringÂ
required
callback
stringÂ
optional
access_token
stringÂ
required
Passing the current users' OAuth2 access token as a GET parameter makes it easier to load this script in a normal HTML
Responses
Modified at 2022-09-11 18:59:48