Trigger Test Link Webhook Event

Trigger Test Link Webhook Event

URL

POST
/webhooks/test/link/{id}
Request
curl --request POST \
--url https://api.moneykit.com/webhooks/test/link/[id] \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--header 'content-type: application/json' \
--data '{"webhook_event":"link.state_changed","webhook_idempotency_key":"string"}'
const options = {
method: 'POST',
headers: {
Authorization: 'Bearer REPLACE_BEARER_TOKEN',
'content-type': 'application/json'
},
body: '{"webhook_event":"link.state_changed","webhook_idempotency_key":"string"}'
};

fetch('https://api.moneykit.com/webhooks/test/link/[id]', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import requests

url = "https://api.moneykit.com/webhooks/test/link/[id]"

payload = {
"webhook_event": "link.state_changed",
"webhook_idempotency_key": "string"
}
headers = {
"Authorization": "Bearer REPLACE_BEARER_TOKEN",
"content-type": "application/json"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)
package main

import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)

func main() {

url := "https://api.moneykit.com/webhooks/test/link/[id]"

payload := strings.NewReader("{\"webhook_event\":\"link.state_changed\",\"webhook_idempotency_key\":\"string\"}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN")
req.Header.Add("content-type", "application/json")

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/webhooks/test/link/[id]")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer REPLACE_BEARER_TOKEN'
request["content-type"] = 'application/json'
request.body = "{\"webhook_event\":\"link.state_changed\",\"webhook_idempotency_key\":\"string\"}"

response = http.request(request)
puts response.read_body
import Foundation

let headers = [
"Authorization": "Bearer REPLACE_BEARER_TOKEN",
"content-type": "application/json"
]
let parameters = [
"webhook_event": "link.state_changed",
"webhook_idempotency_key": "string"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.moneykit.com/webhooks/test/link/[id]")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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
{
"delivery_token": string
}
{
"error_code": "link_error.bad_config",
"error_message": string,
"documentation_url": string
}
{
"error_code": "api_error.auth.expired_access_token",
"error_message": "Access token expired",
"documentation_url": string
}
{
"error_code": "link_error.forbidden_action",
"error_message": "Accounts access not permitted",
"documentation_url": string
}
{
"error_code": "link_error.not_found",
"error_message": "Link not found.",
"documentation_url": string
}
{
"error_code": "link_error.deleted",
"error_message": "This link was deleted at some earlier time.",
"documentation_url": string
}
{
"error_code": "link_error.bad_state",
"error_message": string,
"documentation_url": string,
"link_error_code": string
}
{
"error_code": "api_error.rate_limit_exceeded",
"error_message": "Rate limit exceeded",
"documentation_url": string
}

webhook_event

: string

required

An enumeration.

Allowed values:

"link.state_changed"

"transactions.updates_available"

"product.state_changed"

"link.product_refresh"

webhook_idempotency_key

: string

required

Set this to a unique value that you can check against the delivered webhook payload (webhook_idempotency_key).

id

: string

required

The unique ID for this link.

example: mk_eqkWN34UEoa2NxyALG8pcV

Responses

200

Successful Response

delivery_token

: string

400

Link missing webhook configuration.

error_code

: string

link_error.bad_config

default: "link_error.bad_config"

Allowed values:

"link_error.bad_config"

error_message

: string

documentation_url

: string

403

Forbidden by link owner. The user did not give permission to access this data when linking or testing only supported for sandbox links.

error_code

: string

link_error.forbidden_action

default: "link_error.forbidden_action"

Allowed values:

"link_error.forbidden_action"

error_message

: string

Error message

example: Accounts access not permitted

documentation_url

: string

404

Link not found.

error_code

: string

link_error.not_found

default: "link_error.not_found"

Allowed values:

"link_error.not_found"

error_message

: string

default: "Link not found."

documentation_url

: string

410

Link deleted.

error_code

: string

link_error.deleted

default: "link_error.deleted"

Allowed values:

"link_error.deleted"

error_message

: string

default: "This link was deleted at some earlier time."

documentation_url

: string

422

Link error.

error_code

: string

link_error.bad_state

default: "link_error.bad_state"

Allowed values:

"link_error.bad_state"

error_message

: string

documentation_url

: string

429

Rate limit exceeded.

error_code

: string

api_error.rate_limit_exceeded

default: "api_error.rate_limit_exceeded"

Allowed values:

"api_error.rate_limit_exceeded"

error_message

: string

Error message

default: "Rate limit exceeded"

documentation_url

: string