Get Profile
Get Prakerja Account
Digunakan untuk mendapatkan Prakerja Account, menggunakan Access Tokentoken.
Request
1curl --location 'https://api-proxy.prakerja.go.id/api/v1/resource/user_profile' \
2--header 'X-Client-Id: CLIENT_CODE'
3--header 'Authorization: ACCESS_TOKEN'
Endpoint Path
/api/v1/resource/user_profile
Method
GETHeader
Key | Value |
---|---|
X-Client-Id | Unique Client ID yang disediakan Prakerja ke DP / LP. Prakerja akan menyediakan credential yaitu kombinasi client_code dan sign_key ke DP / LP. |
Authorization | access_token di dapatkan ketika membuat token, lihat kembali halaman ini untuk lebih detail. |
Response
Success Response
Response 200 OK
1{
2 "message": "no error",
3 "success": true,
4 "errorCode": "0",
5 "data": {
6 "dp_user_id": "USER_ID_DP",
7 "email": "EMAIL",
8 "name": "NAMA",
9 "no_prakerja": "ID_PRAKERJA",
10 "phone_number": "NO_TELP",
11 "user_id": "USER_ID"
12 }
13}
Response Detail
Field | Type | Description |
---|---|---|
message | string | Deskripsi status hit API |
success | boolean | Status hit API,
|
errorCode | string | Kode error di response API. Format ERRXXX |
data.dp_user_id | string | User ID pada platform DP. |
data.email | string | Email pada Akun Prakerja. |
data.name | string | Nama pada Akun Prakerja. |
data.no_prakerja | string | Nomor Prakerja. |
data.phone_number | string | Nomor telepon user pada akun Prakerja. |
data.user_id | string | User ID pada Akun Prakerja. |
Error Response
- Termasuk juga list error general response
- Response 400 Bad Request NotFoundContextClientId
1{ 2 "code": "ERROAUTH4024", 3 "message": "Unauthorized", 4 "success": false 5}
- Response 400 Bad Request ErrOauthClientIdNotFound
1{ 2 "code": "ERROAUTH4029", 3 "message": "Unauthorized", 4 "success": false 5}
- Response 400 Bad Request NotFoundContextUserId
1{ 2 "code": "ERROAUTH4030", 3 "message": "Unauthorized", 4 "success": false 5}
- Response 400 Bad Request ErrOauthAuthCodeNotFound
1{ 2 "code": "ERROAUTH4031", 3 "message": "Unauthorized", 4 "success": false 5}
- Response 400 Bad Request ErrOauthAuthCodeNotSame
1{ 2 "code": "ERROAUTH4032", 3 "message": "Unauthorized", 4 "success": false 5}
- Response 400 Bad Request ErrScopeNotMatch
1{ 2 "code": "ERROAUTH4033", 3 "message": "scope tidak sesuai", 4 "success": false 5}
- Response 400 Bad Request ErrSignatureTimestampNotInteger
1{ 2 "code": "ERROAUTH4034", 3 "message": "timestamp harus integer", 4 "success": false 5}
- Response 400 Bad Request ErrSignatureTimestampValueGreaterThanServerNow
1{ 2 "code": "ERROAUTH4035", 3 "message": "timestamp melebihi waktu server", 4 "success": false 5}
- Response 400 Bad Request ErrSignatureExpired
1{ 2 "code": "ERROAUTH4036", 3 "message": "Signature expired", 4 "success": false 5}
- Response 400 Bad Request ErrSignaturePayloadInvalidJSON
1{ 2 "code": "ERROAUTH4037", 3 "message": "Signature payload invalid JSON", 4 "success": false 5}
- Response 400 Bad Request ErrSignatureNotMatch
1{ 2 "code": "ERROAUTH4038", 3 "message": "Signature not match", 4 "success": false 5}
- Response 400 Bad Request ErrMissingSignature
1{ 2 "code": "ERROAUTH4039", 3 "message": "Signature not found", 4 "success": false 5}
- Response 400 Bad Request ErrMissingTimestamp
1{ 2 "code": "ERROAUTH4040", 3 "message": "Timestamp not found", 4 "success": false 5}
- Response 400 Bad Request ErrMissingMethod
1{ 2 "code": "ERROAUTH4041", 3 "message": "Method not found", 4 "success": false 5}
- Response 400 Bad Request ErrGrantTypeNotMatch
1{ 2 "code": "ERROAUTH4042", 3 "message": "grant_type tidak sesuai", 4 "success": false 5}
- Response 400 Bad Request ErrRefreshTokenKeyNotFound
1{ 2 "code": "ERROAUTH4043", 3 "message": "Refresh token key not found", 4 "success": false 5}
- Response 400 Bad Request ErrValidationInput
1{ 2 "code": "ERROAUTH4044", 3 "message": "Input tidak valid", 4 "success": false 5}
- Response 400 Bad Request ErrRedirectUriNotValid
1{ 2 "code": "ERROAUTH4045", 3 "message": "Redirect URI not valid", 4 "success": false 5}
- Response 400 Bad Request ErrLoginUriNotValid
1{ 2 "code": "ERROAUTH4046", 3 "message": "Login URI not valid", 4 "success": false 5}
- Response 400 Bad Request ErrValidateJWTAuthCode
1{ 2 "code": "ERROAUTH4047", 3 "message": "Unauthorized", 4 "success": false 5}
- Response 400 Bad Request ErrValidateJWTToken
1{ 2 "code": "ERROAUTH4048", 3 "message": "Unauthorized", 4 "success": false 5}
- Response 400 Bad Request ErrCreateJWTToken
1{ 2 "code": "ERROAUTH4049", 3 "message": "Unauthorized", 4 "success": false 5}
- Response 400 Bad Request ErrJWTSignKeyNotMatch
1{ 2 "code": "ERROAUTH4050", 3 "message": "Unauthorized", 4 "success": false 5}
- Response 400 Bad Request ErrTokenExpired
1{ 2 "code": "ERROAUTH4051", 3 "message": "Token expired", 4 "success": false 5}
- Response 400 Bad Request ErrOauthAuthCodeExpired
1{ 2 "code": "ERROAUTH4052", 3 "message": "Auth code expired", 4 "success": false 5}
- Response 400 Bad Request ErrTokenNotFoundHeader
1{ 2 "code": "ERROAUTH4053", 3 "message": "Token not found", 4 "success": false 5}
Try this API
Example Code
1// Generated by Prakerja Generator
2// for complete documentation please visit https://developer.prakerja.go.id
3
4const crypto = require('crypto-js');
5const axios = require('axios');
6
7const client_code = "";
8const method = "GET";
9const url = "https://api.prakerja.go.id/api/v1/resource/user_profile";
10const headers = {
11 "X-Client-Id": client_code,
12 "Authorization": "",
13};
14
15axios({
16 method,
17 url,
18 headers,
19})
20.then((response) => {
21 console.log(response.data)
22})
23.catch((error) => {
24 console.log(error.response.data)
25});
1<?php
2// Generated by Prakerja Generator
3// for complete documentation please visit https://developer.prakerja.go.id
4
5$client_code = "";
6$method = "GET";
7$url = "https://api.prakerja.go.id/api/v1/resource/user_profile";
8$headers = [
9 "X-Client-Id: " . $client_code,
10 "Authorization: ",
11];
12
13$ch = curl_init();
14curl_setopt($ch, CURLOPT_URL, $url );
15curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
16curl_setopt($ch, CURLOPT_POST, 1);
17curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
18curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
19$result = curl_exec($ch);
20curl_close ($ch);
21
22print_r("result: ");
23print_r(json_decode($result));
1# Generated by Prakerja Generator
2# for complete documentation please visit https://developer.prakerja.go.id
3
4from hashlib import sha1
5import hmac
6import time
7import json
8import requests
9
10client_code = ""
11method = "GET"
12url = "https://api.prakerja.go.id/api/v1/resource/user_profile"
13headers = {
14 "X-Client-Id": client_code,
15 "Authorization": "",
16}
17
18result = requests.get(
19 url,
20 headers=headers
21)
22
23print('result: ')
24print(json.loads(result.text))
1# Generated by Prakerja Generator
2# for complete documentation please visit https://developer.prakerja.go.id
3
4require 'base64'
5require 'cgi'
6require 'openssl'
7require 'net/http'
8require 'uri'
9require 'json'
10
11client_code = ""
12url = "https://api.prakerja.go.id/api/v1/resource/user_profile"
13
14uri = URI.parse(url)
15request = Net::HTTP::Get.new(uri)
16request.content_type = "application/json"
17request['X-Client-Id'] = client_code
18request['Authorization'] = ""
19
20req_options = {
21 use_ssl: uri.scheme == "https",
22}
23
24result = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
25http.request(request)
26end
27
28# result.code
29# result.body
30puts 'result: '
31puts JSON.parse(result.body)