Skip to main content

Ping Access API Method

Return a successful response if the Access API is ready and available.

Updated on
Oct 4, 2023

Ping Access API Method

Parameters

This method does not accept any parameters

Returns

value
string
If a ping request returns an error or times out, it can be assumed that the Access API is unavailable. Otherwise the Access API is available
Request
1
package main
2
3
import (
4
"context"
5
"log"
6
7
"github.com/onflow/flow/protobuf/go/flow/access"
8
)
9
10
func main() {
11
12
// Requires authenticating before making the request. Refer to Intro Page on how Authentication can be done.
13
client, err := getAccessClientWithBasicAuth("ENDPOINT-NAME", "TOKEN_GOES_HERE")
14
ctx := context.Background()
15
if err != null {
16
log.Fatalf("err: %v", err)
17
}
18
// Ping
19
res, err := client.Ping(ctx, &access.PingRequest{})
20
if err != null {
21
log.Fatal("ping failed: ", err)
22
}
23
println("Ping returned", res)
24
}
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free