Skip to content

Instantly share code, notes, and snippets.

@coffe67
Created December 13, 2014 17:08
Show Gist options
  • Save coffe67/07f2ebc839013011eec3 to your computer and use it in GitHub Desktop.
Save coffe67/07f2ebc839013011eec3 to your computer and use it in GitHub Desktop.

TicTic API

ver 0.1.0

Overview

This describes the functionality to user the api v1 of api, any problem or request please contact to HydraLab

All the api si accesed via HTTPS, and access with the route: domain.com/api/v1/, all data to send and received as JSON.

The API attempts to return appropriate HTTP status codes for every request. It is possible to suppress response codes for the REST API.

Code Text Description
200 OK Success!
304 Not Modified There was no new data to return.
400 Bad Request The request was invalid or cannot be otherwise served. An accompanying error message will explain further. In API v1.1, requests without authentication are considered invalid and will yield this response.
401 Unauthorized Authentication credentials were missing or incorrect.
403 Forbidden The request is understood, but it has been refused or access is not allowed. An accompanying error message will explain why. This code is used when requests are being denied due to update limits.
404 Not Found The URI requested is invalid or the resource requested, such as a user, does not exists. Also returned when the requested format is not supported by the requested method.
406 Not Acceptable Returned by the Search API when an invalid format is specified in the request.
410 Gone This resource is gone. Used to indicate that an API endpoint has been turned off. For example: "The Folgom REST API v1 will soon stop functioning. Please migrate to API v1.1."
420 Enhance Your Calm Returned by the version 1 Search and Trends APIs when you are being rate limited.
422 Unprocessable Entity Returned when an image uploaded to POST account/update_profile_banner is unable to be processed.
429 Too Many Requests Returned in API v1.1 when a request cannot be served due to the application's rate limit having been exhausted for the resource. See Rate Limiting in API v1.1.
500 Internal Server Error Something is broken. Please post to the group so the Api team can investigate.
502 Bad Gateway Api is down or being upgraded.
503 Service Unavailable The Api servers are up, but overloaded with requests. Try again later.
504 Gateway timeout The Api servers are up, but the request couldn't be serviced due to some failure within our stack. Try again later.

This section describe all the functionalities that a user have.

GET /api/v1/users

This class returns a list with all the users on the system

Return

[
    {
        "id": 1,
        "creation_date": "2014-12-13",
        "linkedin_user": "x",
        "linkedin_user_token": "x",
        "linkedin_auth_key": "xx",
        "first_name": "some",
        "last_name": "Some",
        "picture": "xxxxxxx",
        "lookfor": "",
        "hire": "",
        "pitch": "",
        "kind_of_user": "Employee",
        "lat": "",
        "longitud": "",
        "is_active": false,
        "skills": []
    },
    {
        "id": 2,
        "creation_date": "2014-12-13",
        "linkedin_user": "some",
        "linkedin_user_token": "x",
        "linkedin_auth_key": "xx",
        "first_name": "some",
        "last_name": "Some",
        "picture": "xxxxxxx",
        "lookfor": "",
        "hire": "",
        "pitch": "",
        "kind_of_user": "Employee",
        "lat": "",
        "longitud": "",
        "is_active": false,
        "skills": []
    },
 ]

POST /api/v1/user/login

This is the login via linkedin confirmation from mobile device

Parameter Type Description
linkedin_user String This field contain the Linkedin user
linkedin_user _token String This field contain the token to col send push notiications
linkedin_auth _key String This field contain the Linkedin Authentication Key from the user
first_name String
last_name String
picture URL This URL correspond to the Image Profile from linkedin
latitud String
longitud Strign

Return

{
        "id": 2,
        "creation_date": "2014-12-13",
        "linkedin_user": "some",
        "linkedin_user_token": "x",
        "linkedin_auth_key": "xx",
        "first_name": "some",
        "last_name": "Some",
        "picture": "xxxxxxx",
        "lookfor": "",
        "hire": "",
        "pitch": "",
        "kind_of_user": "Employee",
        "latitud": "",
        "longitud": "",
        "is_active": false,
        "skills": []
    }

Error

Return 400 error and the message about the error.

{
    "linkedin_user": [
        "This field may not be blank."
    ],
    "first_name": [
        "This field may not be blank."
    ],
    "last_name": [
        "This field may not be blank."
    ],
    "picture": [
        "This field may not be blank."
    ],
    "linkedin_auth_key": [
        "This field may not be blank."
    ],
    "linkedin_user_token": [
        "This field may not be blank."
    ]
}

This describe how work with users profiels

GET /api/v1/profiles/:user_id

This is the params to need to send when you request a profile:

Parameter Type Description
user_id Integer This ID its unique for every user

Return

{
        "id": 2,
        "creation_date": "2014-12-13",
        "linkedin_user": "some",
        "linkedin_user_token": "x",
        "linkedin_auth_key": "xx",
        "first_name": "some",
        "last_name": "Some",
        "picture": "xxxxxxx",
        "lookfor": "",
        "hire": "",
        "pitch": "",
        "kind_of_user": "Employee",
        "latitud": "",
        "longitud": "",
        "is_active": false,
        "skills": []
    }

Error This retur the code 404, and array with the message errors.

{
    "detail": "Not found"
}

POST /api/v1/profiles/:user_id

This is the params to need to send when you request update a profile:

Parameter Type Description
user_id Integer This ID its unique for every user
linkedin_user String This field contain the Linkedin user
linkedin_user _token String This field contain the token to col send push notiications
linkedin_auth _key String This field contain the Linkedin Authentication Key from the user
first_name String
last_name String
picture URL This URL correspond to the Image Profile from linkedin
latitud String
longitud Strign

Return

{
        "id": 2,
        "creation_date": "2014-12-13",
        "linkedin_user": "some",
        "linkedin_user_token": "x",
        "linkedin_auth_key": "xx",
        "first_name": "some",
        "last_name": "Some",
        "picture": "xxxxxxx",
        "lookfor": "",
        "hire": "",
        "pitch": "",
        "kind_of_user": "Employee",
        "latitud": "",
        "longitud": "",
        "is_active": false,
        "skills": []
    }

Error This retur the code 404, and array with the message errors.

{
    "detail": "Not found"
}

The attributes describe all options that a lot of profiles could have, for example, Skills, Business Sector, Project.

GET /api/v1/skills

This end point return a list of skill registred in the system

Response

{
    "id": 1,
    "skill_name": "PHP"
}

Errors

This describe 400 error

{
    "skill_name": [
        "This field may not be blank."
    ]
}

POST /api/v1/skills

This end point registry a new skill on the system, all of this are necessary to be assigned a profile.

Parameter Type Description
skill_name String

License

Copyright (c) 2014 TicTic.me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment