Public API¶
This documentation will help you to integrate with PushResume API
Routes¶
Resource | Operation | Description |
---|---|---|
auth | POST /auth/(provider_name) | Retrieve JWT token to access protected routes |
GET /auth/(provider_name) | Retrieve redirect URL to provider’s auth page | |
GET /auth/providers | Retrieve providers list | |
GET /auth/refresh | Refresh exists JWT token (reset TTL) | |
protected | GET /resume | Retrieve user’s resume list directly from provider |
POST /resume | Toggle automatically publish user’s resume | |
stats | GET /stats | Application’s usage statistic |
Methods¶
-
POST
/auth/
(provider_name)¶ Log-in user, returns JWT token for signing future requests to protected routes.
Request:
POST /auth/<provider_name> HTTP/1.1 Content-Type: application/json { "code": "qwerty" }
Response:
HTTP/1.1 200 OK Content-Type: application/json { "token": "q1w2.e3r4.t5y" }
Request JSON Object: - code (string) – authorization code from callback
Status Codes: - 200 OK – OK
- 400 Bad Request – invalid JSON in request’s body
- 401 Unauthorized – auth errors
- 500 Internal Server Error – unexpected errors
- 503 Service Unavailable – provider errors
-
GET
/auth/
(provider_name)¶ Returns URL for redirect user to provider’s auth page
Request:
GET /auth/<provider_name> HTTP/1.1
Response:
HTTP/1.1 200 OK Content-Type: application/json { "redirect": "http://<provider's_auth_page>" }
Status Codes: - 200 OK – OK
- 500 Internal Server Error – unexpected errors
- 503 Service Unavailable – provider errors
-
GET
/auth/providers
¶ Providers list
Request:
GET /auth/providers HTTP/1.1
Response:
HTTP/1.1 200 OK Content-Type: application/json [ "provider_one", "provider_two" ]
Status Codes: - 200 OK – OK
- 500 Internal Server Error – unexpected errors
-
GET
/auth/refresh
¶ Returns new JWT token with fresh expiration date
Request:
GET /auth/refresh HTTP/1.1 Authorization: JWT q1w2.e3r4.t5y
Response:
HTTP/1.1 200 OK Content-Type: application/json { "token": "q1w2.e3r4.t5y" }
Request Headers: - Authorization – valid JWT token
Status Codes: - 200 OK – OK
- 401 Unauthorized – auth errors
- 500 Internal Server Error – unexpected errors
-
GET
/resume
¶ User’s resume list
Request:
GET /refresh HTTP/1.1 Authorization: JWT q1w2.e3r4.t5y
Response:
HTTP/1.1 200 OK Content-Type: application/json [ { "enabled": true, "link": "https://<provider's resume page>", "name": "John Doe", "published": "2018-08-19T17:41:52+0300", "title": "Proctologist-jeweler", "uniq": "erwhy2333r23rd2r32er23" } ]
Request Headers: - Authorization – valid JWT token
Status Codes: - 200 OK – OK
- 401 Unauthorized – auth errors
- 500 Internal Server Error – unexpected errors
- 503 Service Unavailable – provider errors
-
POST
/resume
¶ Enable/disable automatically publish user’s resume
Request:
POST /resume HTTP/1.1 Content-Type: application/json { "uniq": "q1w2e3r4t5y6" }
Response:
HTTP/1.1 200 OK Content-Type: application/json { "enabled": true }
Request JSON Object: - uniq (string) – provider’s resume id
Status Codes: - 200 OK – OK
- 400 Bad Request – invalid JSON in request’s body
- 401 Unauthorized – auth errors
- 500 Internal Server Error – unexpected errors
-
GET
/stats
¶ Application’s usage statistic, update every 5 minutes