REST API

The REST APIs provides programmatic access to read Sharesome data. Read author profile data, login with Sharesome and more. The REST API identifies Sharesome applications and users using OAuth; responses are available in JSON.

Current Version

The current vesion of the Sharesome API is v1. This is used explicitly in the request URL (sharesome.com/api/v1/). All data is received as JSON.

HTTP Verbs

The Sharesome API follows the REST architectural style and strives to use appropriate HTTP verbs for each action.

Verb Description
HEAD Can be issued against any resource to get just the HTTP header info.
GET Used for retrieving resources.
POST Used for creating resources.
PATCH Used for updating resources with partial JSON data. For instance, an Issue resource has title and body attributes. A PATCH request may accept one or more of the attributes to update the resource. PATCH is a relatively new and uncommon HTTP verb, so resource endpoints also accept POST requests.
PUT Used for replacing resources or collections. For PUT requests with no body attribute, be sure to set the Content-Length header to zero.
DELETE Used for deleting resources.

User Endpoint

To get the authenticated user data a GET request must be made to the the following link:

GET http://sharesome.com/api/v1/user

This request requires authentication. This is to prevent the accidental leakage of private repositories to unauthorized users. Sharesome API uses OAuth2 for authentication.

Response

{
  "success": true,
  "user": {
    "id": 1,
    "username": "Username",
    "email": "user@example.com",
    "name": "Name",
    "star": true,
    "avatar": "https:\\/\\/pornfeyer.com\\/path-to-user-avatar.jpg"
  }
}

The parameters returned for the user are the following:

Name Type Description
id integer A unique identifier for the user.
username string The username of the user. It can be used to make the link to the user profile (http://sharesome.com/{username}).
email string Publicly visible email address.
name string The name of the user.
star boolean If the user is a Sharesome verified Porn Star this will return true, othewise will return false.
avatar string The URL to the user Avatar.

Check out our Sharesome SDK for PHP for a easy integration with your PHP project.