Get User Links
Get User Links
Fetches all links belonging to a user.
URL
GET
/users/{id}/links
Request
curl --request GET \
--url https://api.moneykit.com/users/[id]/links \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
const options = {method: 'GET', headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'}};
fetch('https://api.moneykit.com/users/[id]/links', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import requests
url = "https://api.moneykit.com/users/[id]/links"
headers = {"Authorization": "Bearer REPLACE_BEARER_TOKEN"}
response = requests.request("GET", url, headers=headers)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.moneykit.com/users/[id]/links"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.moneykit.com/users/[id]/links")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer REPLACE_BEARER_TOKEN'
response = http.request(request)
puts response.read_body
import Foundation
let headers = ["Authorization": "Bearer REPLACE_BEARER_TOKEN"]
let request = NSMutableURLRequest(url: NSURL(string: "https://api.moneykit.com/users/[id]/links")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
Response
{
"links": {
"mk_eqkWN34UEoa2NxyALG8pcV": {
"link_id": "mk_eqkWN34UEoa2NxyALG8pcV",
"institution_id": "chase",
"institution_name": "Chase",
"institution_avatar": "https://example.com/avatar.png",
"state": "connected",
"error_code": null,
"provider": "mx",
"link_tags": [
"smoke_test",
"user_type:admin"
],
"webhook": "https://example.com/webhook",
"products": {
"accounts": {
"refreshed_at": "2023-02-16T09:14:11",
"last_attempted_at": "2023-02-16T09:14:11",
"error_code": "rate_limit",
"error_message": string,
"unavailable": string
},
"account_numbers": {
"refreshed_at": "2023-02-16T09:14:11",
"last_attempted_at": "2023-02-16T09:14:11",
"error_code": "rate_limit",
"error_message": string,
"unavailable": string
},
"identity": {
"refreshed_at": "2023-02-16T09:14:11",
"last_attempted_at": "2023-02-16T09:14:11",
"error_code": "rate_limit",
"error_message": string,
"unavailable": string
},
"transactions": {
"refreshed_at": "2023-02-16T09:14:11",
"last_attempted_at": "2023-02-16T09:14:11",
"error_code": "rate_limit",
"error_message": string,
"unavailable": string
},
"investments": {
"refreshed_at": "2023-02-16T09:14:11",
"last_attempted_at": "2023-02-16T09:14:11",
"error_code": "rate_limit",
"error_message": string,
"unavailable": string
},
"enrichment": {
"refreshed_at": "2023-02-16T09:14:11",
"last_attempted_at": "2023-02-16T09:14:11",
"error_code": "rate_limit",
"error_message": string,
"unavailable": string
}
},
"available_products": [
"account_numbers"
]
}
}
}
{
"error_code": "api_error.auth.expired_access_token",
"error_message": "Access token expired",
"documentation_url": string
}
id
: string
required
The unique ID for this user. This is the same ID provided in the call to link-session to create any link for this user.
example: MyUser1234
Responses
200
Successful Response
links
: object
The set of links belonging to this user, as a dictionary
of {link_id:link}
.
Request
curl --request GET \
--url https://api.moneykit.com/users/[id]/links \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
const options = {method: 'GET', headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'}};
fetch('https://api.moneykit.com/users/[id]/links', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import requests
url = "https://api.moneykit.com/users/[id]/links"
headers = {"Authorization": "Bearer REPLACE_BEARER_TOKEN"}
response = requests.request("GET", url, headers=headers)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.moneykit.com/users/[id]/links"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.moneykit.com/users/[id]/links")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer REPLACE_BEARER_TOKEN'
response = http.request(request)
puts response.read_body
import Foundation
let headers = ["Authorization": "Bearer REPLACE_BEARER_TOKEN"]
let request = NSMutableURLRequest(url: NSURL(string: "https://api.moneykit.com/users/[id]/links")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
Response
{
"links": {
"mk_eqkWN34UEoa2NxyALG8pcV": {
"link_id": "mk_eqkWN34UEoa2NxyALG8pcV",
"institution_id": "chase",
"institution_name": "Chase",
"institution_avatar": "https://example.com/avatar.png",
"state": "connected",
"error_code": null,
"provider": "mx",
"link_tags": [
"smoke_test",
"user_type:admin"
],
"webhook": "https://example.com/webhook",
"products": {
"accounts": {
"refreshed_at": "2023-02-16T09:14:11",
"last_attempted_at": "2023-02-16T09:14:11",
"error_code": "rate_limit",
"error_message": string,
"unavailable": string
},
"account_numbers": {
"refreshed_at": "2023-02-16T09:14:11",
"last_attempted_at": "2023-02-16T09:14:11",
"error_code": "rate_limit",
"error_message": string,
"unavailable": string
},
"identity": {
"refreshed_at": "2023-02-16T09:14:11",
"last_attempted_at": "2023-02-16T09:14:11",
"error_code": "rate_limit",
"error_message": string,
"unavailable": string
},
"transactions": {
"refreshed_at": "2023-02-16T09:14:11",
"last_attempted_at": "2023-02-16T09:14:11",
"error_code": "rate_limit",
"error_message": string,
"unavailable": string
},
"investments": {
"refreshed_at": "2023-02-16T09:14:11",
"last_attempted_at": "2023-02-16T09:14:11",
"error_code": "rate_limit",
"error_message": string,
"unavailable": string
},
"enrichment": {
"refreshed_at": "2023-02-16T09:14:11",
"last_attempted_at": "2023-02-16T09:14:11",
"error_code": "rate_limit",
"error_message": string,
"unavailable": string
}
},
"available_products": [
"account_numbers"
]
}
}
}
{
"error_code": "api_error.auth.expired_access_token",
"error_message": "Access token expired",
"documentation_url": string
}