API
Quick notes and usage reference for
seacontact.com API.
Methods
Here you can find current methods supported by the api
Standart Fields
In this section you can find list of standart fields, information in this section is dynamicaly taken from the engine so you can refer to it when querying the api.
For each parameter you can specify coma separated name of fields returned by the request. Acceptable parameters and fields are:
- pics
- likes
- likers
- like_status
- views
- subscribers
- subscribe_status
- answers
- answered
- votes
- up_votes
- down_votes
- total_rating
- vote_status
- videos
- links
- soc_likes
- soc_likers
- total_comments
- comments_list
- soc_comments_list
- vk_last_comment_id
- id
- login
- role
- type
- sex
- avatar
- cv_avatar
- name
- surname
- full_name
- contact_mobile
- contact_mobile_2
- contact_phone
- contact_phone_2
- desired_rank
- minimum_salary
- salary_currency
- visa_usa
- visa_usa_exp
- visa_shenghen
- visa_shenghen_exp
- dob
- nationality
- place_of_residence
- home_city
- home_address
- contact_mobile
- contact_mobile_2
- contact_phone
- contact_phone_2
- english_knowledge
- marital_status
- user_notes
- last_activity
- in_db_date
- reg_date
- readiness_date
- company_name
- company_description
- company_license
- social_vk_domain
- id
- user
- title
- text
- video
- anonym
- tags
- time
- post_vk
- post_vk_id
- post_vk_time
- post_vk_wall
- active
- id
- question_id
- user
- text
- video
- anonym
- correct
- tags
- time
- post_vk
- post_vk_id
- post_vk_time
- post_vk_wall
- active
- soc_name
- soc_post_id
- soc_answer_id
- soc_user_id
- soc_likes
- id
- user
- for_company
- title
- publish
- text
- video
- tags
- rank
- salary
- salary_unit
- ship_name
- ship_type
- ship_dwt
- ship_built
- date_join
- contract_length
- crew_nationality
- english
- comments
- urgent
- time
- post_vk
- post_vk_id
- post_vk_time
- post_vk_wall
- post_fb
- post_in
- active
- id
- user
- title
- tags
- text
- video
- location
- time
- post_vk
- post_vk_id
- post_vk_time
- post_vk_wall
- post_fb_id
- post_fb_time
- active
- id
- user_id
- section
- section_id
- comment
- reply_on
- rating
- time
- active
- id
- user_id
- section
- section_id
- time
- worked_together
- worked_on
- worked_together_from
- worked_together_to
- relations
- id
- user
- ship_name
- text
- date_from
- date_to
- rank
- flag
- dwt
- grt
- bhp
- ship_type
- engine
- ship_built
- company
- crewing
- trading_area
- time
- id
- user
- title
- number
- type
- grade
- issue_date
- expiry_date
- issue_place
- time
- id
- to_user_id
- from_user_id
- not_type
- not_section
- not_section_id
- time
- not_message
- mail_sent
- readed
- id
- from_id
- to_id
- text
- readed
- chat_id
- active
- time
- id
- user
- img
- thumb
- alt
- place
- time
- id
- user_id
- section
- section_id
- title
- description
- embed_url
- url
- thumb
- time
- id
- section
- section_id
- user_id
- title
- description
- url
- thumb
- time
For comments, likes, notifications, and some other objects you will need to specify 'section' and 'section_id' parameters. Allowed sections you can find here:
- vacancy
- logbook
- user
- questions
- answers
- comments
- s_comments
Requests to the API
HTTP Methods Negotiation
Api takes care of HTTP method negotiation for you. This means if a request is made via a method you have not allowed, it will report this to the user with a 405 status code, and also report which methods are allowed via the Allow response header.
HTTP/1.1 405 Method Not Allowed Allow: GET
Content Negotiation
Currently API support requests and response in JSON. If you specify a different media type in the Accept header, it reports that it cannot handle it.
If you perform a GET request to the service, and specify that you want HTML:
GET api.seacontact.com/users.get HTTP/1.1 Accept: text/html
This will return an error:
HTTP/1.1 406 Not Acceptable Content-Type: application/problem+json { "detail": "Cannot honor Accept type specified", "status": 406, "title": "Not Acceptable", "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" }
try requesting JSON:
GET api.seacontact.com/users.get HTTP/1.1 Accept: application/json
This will work!
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "data_list":[{ "user_id":"39077", "name":"vasya batareykin", "surname":"*******", "full_name":"*******", "email":"*******", "contact_mobile":"*******", "desired_rank":"*******" }], "total_results":"38677", "_page":1, "_limit":"1" }
Terminology
- Entity
- An object of information: user, vacancy or question item. Each item can contain fields
- Field
- A property of an Entity, it can be username or likes quantity for the blog post
- Collection
- A addressable set of entities. Typically, all entities contained in the collection are of the same type
Most of the GET methods of the API returning a collection of entities.
Request
Every request to the collection can contain standart fields:
- _%name of section%_fields
- Comma separated list of entity fields
- _limit
- Quantity of results per page, required for pagination, maximum is 100
- _page
- Current page of collection
- Filters
- Other parameters to filter the result
Response
Every Collection response have a standart fields:
- data_list
- List of entities
- total_results
- Total quantity of entities for that query
- _limit
- Quantity of results per page
- _page
- Current page
When requesting a collection you can specify which fields should be returned in response.
Usualy every entity has its own fields, lets say, for the question entity it will be id, title, text etc.
to specify question fields add comma separated names of them with the _question_fields option in request.
GET /questions.get?_question_fields=id,title,text&access_token=e8a9f857f0f02bc5d0b066b94d341bedd9dc2646
Some collection also have additional fields associated with item, lets say every question also have a user which had posted it.
For this collections you can specify _user_fields parameter, with comma separated field names
GET /questions.get?_question_fields=id,title,text&_user_fields=user_id,login,name,surname&access_token=e8a9f857f0f02bc5d0b066b94d341bedd9dc2646
For filtering the result you can specify required values for other fields in the request. You can refer this example to see some of the options
GET /questions.get?_question_fields=id,title&_user_fields=id,login,name,surname&_stats_fields=answers,likes&unanswered=1&query=море&_limit=2&access_token=38f6aba03e7f969d83fd2ddebd6038039a79cda3
And typical response will be
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "data_list":[ { "question_id":"20", "id":"38901", "title":"\u041c\u0435\u0434\u0438\u0446\u0438\u043d\u0441\u043a\u0438\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b", "user_id":"38901", "login":"IgorrSidorenko", "name":"Igor", "surname":"*******", "likes":"0", "answers":"3" }, { "question_id":"17", "id":"38901", "title":"\u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0434\u0438\u043f\u043b\u043e\u043c\u043e\u0432", "user_id":"38901", "login":"IgorrSidorenko", "name":"Igor", "surname":"*******", "likes":"0", "answers":"0" } ], "total_results":"7", "_page":1, "_limit":"2" }
You can see that some fields are hashed with ******, it means that user who request this information dont have access to this fields.
Most of the information hashed is user personal data, and it can be revealed only for user with appropriate rights: companies (if user in their database), user friends etc.
For more detailed information please refer to the Standart Fields section and Methods section
