Access the user account
Access the newly created user accounts.
2 minute read
Access user account
If you are creating professional
or bespoke
accounts, you will have to create the accounts manually.
First, let’s get all accounts associated to the user:
1
2
3
4
5
curl -X \
--request GET \
--url "https://alpha.api.pocket-portfolio.com/object/account/list" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${ ACCESS_TOKEN } "
You should receive an array populated with universally unique identifiers (RFC 4122 complaint) to the user accounts.
1
2
3
4
5
6
7
8
[
"059cc47f-b1f3-490b-ac1f-dd3e1457297d" ,
"ff598b1b-86fe-45fe-8b8f-27fe6e8dc7f2"
]
export \
USER_ACCOUNT_ID = "059cc47f-b1f3-490b-ac1f-dd3e1457297d" \
USER_SANDBOX_ACCOUNT_ID = "ff598b1b-86fe-45fe-8b8f-27fe6e8dc7f2"
1
"Unauthorized access - Unauthorized - you do not have access to this API"
Check account status:
1
2
3
4
5
curl -X \
--request GET \
--url "https://alpha.api.pocket-portfolio.com/object/account/status" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${ ACCESS_TOKEN } "
You should see two accounts; the first account is the production account as indicated with the is_sandbox=false
flag–which you’ll be billed for, and the second account is the sandbox account, which you can use as an isolated, non-billable environment to test different resources (AIs).
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[
{
"account_id" : "059cc47f-b1f3-490b-ac1f-dd3e1457297d" ,
"is_verified" : false,
"is_omnibus" : false,
"is_managed" : false,
"is_headless" : true,
"is_hold" : false,
"is_closed" : false,
"is_sandbox" : false
} ,
{
"account_id" : "ff598b1b-86fe-45fe-8b8f-27fe6e8dc7f2" ,
"is_verified" : false,
"is_omnibus" : false,
"is_managed" : false,
"is_headless" : true,
"is_hold" : false,
"is_closed" : false,
"is_sandbox" : true
}
]
1
"Unauthorized access - Unauthorized - you do not have access to this API"
Account is not yet verified!
You may notice that the account is_verified
is still in the false
state. Most Pocket endpoints will be unavailable until the user has completed verification. At which point, once the user’s identity is verified, the account will be marked true
.
Get account details:
1
2
3
4
5
curl -X \
--request GET \
--url "https://alpha.api.pocket-portfolio.com/object/account/ ${ USER_ACCOUNT_ID } " \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${ ACCESS_TOKEN } "
You should get the below:
1
2
3
4
5
6
7
8
9
10
11
12
[
{
"account_id" : "059cc47f-b1f3-490b-ac1f-dd3e1457297d" ,
"parent_account_id" : null,
"account_type" : "SMA" ,
"user_id" : "60107f369dbd1a0068f0232a" ,
"accounting_method" : "WAC" ,
"created_at" : "2021-02-06T16:52:14.129Z" ,
"updated_at" : "2022-02-06T16:52:14.129Z" ,
"closed_at" : null
}
]
1
"Unauthorized access - Unauthorized - you do not have access to this API"
👍 Báječné! You’ve accessed your newly created account on the Pocket Cloud
!
Last modified April 3, 2023:
fix ubuntu issues (dc29291)