Classifieds
Through the member portal API you can perform many operations on classifieds. A classified represents something that a member wants to sell to other members.
Get Classifieds
{
"action":"get_classifieds",
"limit": <number>",
"offset":<number>
}
A successful response will have an array of classifieds in JSON data format. Each classified contains the following data:
{
"created":<unix_timestamp>,
"deleted":null,
"description":<string>,
"fullCount":<number:total number of classifieds>,
"id":<number>,
"images": <optional: array of image data>,
"label":<string>,
"memberId": <number: id of member selling item>,
"price":<number>
}
If there are images each image item will contain the following:
{
"classified":<number>,
"id":<number>,
"imageData":<string: base 64 encoded image data>
}
Create
To create a classified perform a post with the following data:
{ "action":"create_classified", "description":<string>, "images": <optional: array of image data>, "label":<string>, "memberId": <number: id of member selling item>, "price":<number> }
If successful the API will return the id of the created classified.
Update
To update an existing classified perform a post with the following data:
{ "action":"update_classified", "id":<number: id of classified to update> "description":<string>, "images": <optional: array of image data>, "label":<string>, "memberId": <number: id of member selling item>, "price":<number> }
Note that a member can only update a classified that they created. So this option should only be available of the memberId of the classified matches the id of the logged in member.
Delete
To delete an existing classified that the logged in member created, perform a post with the following data:
{
"action":"delete_classified",
"id":<number: id of classified to delete>
}
Getting another members info
Note that in the classified view a member may want to access the contact information for a member that is selling something. To perform this use the following action:
{
"action":"get_member",
"id":<number: id of member>
}
This should only be used when a member wants to view this data, not for every classified in an array.