from dub import Dub
with Dub(
token="DUB_API_KEY",
) as d_client:
res = d_client.links.count(request={
"show_archived": False,
"with_tags": False,
})
# Handle response
print(res)declare(strict_types=1);
require 'vendor/autoload.php';
use Dub;
use Dub\Models\Operations;
$sdk = Dub\Dub::builder()
->setSecurity(
'DUB_API_KEY'
)
->build();
$request = new Operations\GetLinksCountRequest(
showArchived: false,
withTags: false,
);
$response = $sdk->links->count(
request: $request
);
if ($response->number !== null) {
// handle response
}package main
import(
"context"
dubgo "github.com/dubinc/dub-go"
"github.com/dubinc/dub-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := dubgo.New(
dubgo.WithSecurity("DUB_API_KEY"),
)
res, err := s.Links.Count(ctx, operations.GetLinksCountRequest{
ShowArchived: dubgo.Pointer(false),
WithTags: dubgo.Pointer(false),
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}require 'dub'
Models = ::OpenApiSDK::Models
s = ::OpenApiSDK::Dub.new(
security: Models::Shared::Security.new(
token: 'DUB_API_KEY',
),
)
req = Models::Operations::GetLinksCountRequest.new(
show_archived: false,
with_tags: false,
)
res = s.links.count(request: req)
unless res.nil?
# handle response
endimport { Dub } from "dub";
const dub = new Dub({
token: "DUB_API_KEY",
});
async function run() {
const result = await dub.links.count();
console.log(result);
}
run();curl --request GET \
--url https://api.dub.co/links/count \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.dub.co/links/count', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://api.dub.co/links/count")
.header("Authorization", "Bearer <token>")
.asString();123{
"error": {
"code": "bad_request",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#bad-request"
}
}{
"error": {
"code": "unauthorized",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#unauthorized"
}
}{
"error": {
"code": "forbidden",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#forbidden"
}
}{
"error": {
"code": "not_found",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#not-found"
}
}{
"error": {
"code": "conflict",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#conflict"
}
}{
"error": {
"code": "invite_expired",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#invite-expired"
}
}{
"error": {
"code": "unprocessable_entity",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#unprocessable-entity"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#rate-limit_exceeded"
}
}{
"error": {
"code": "internal_server_error",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#internal-server_error"
}
}Retrieve links count
Retrieve the number of links for the authenticated workspace. The provided query parameters allow filtering the returned links.
from dub import Dub
with Dub(
token="DUB_API_KEY",
) as d_client:
res = d_client.links.count(request={
"show_archived": False,
"with_tags": False,
})
# Handle response
print(res)declare(strict_types=1);
require 'vendor/autoload.php';
use Dub;
use Dub\Models\Operations;
$sdk = Dub\Dub::builder()
->setSecurity(
'DUB_API_KEY'
)
->build();
$request = new Operations\GetLinksCountRequest(
showArchived: false,
withTags: false,
);
$response = $sdk->links->count(
request: $request
);
if ($response->number !== null) {
// handle response
}package main
import(
"context"
dubgo "github.com/dubinc/dub-go"
"github.com/dubinc/dub-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := dubgo.New(
dubgo.WithSecurity("DUB_API_KEY"),
)
res, err := s.Links.Count(ctx, operations.GetLinksCountRequest{
ShowArchived: dubgo.Pointer(false),
WithTags: dubgo.Pointer(false),
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}require 'dub'
Models = ::OpenApiSDK::Models
s = ::OpenApiSDK::Dub.new(
security: Models::Shared::Security.new(
token: 'DUB_API_KEY',
),
)
req = Models::Operations::GetLinksCountRequest.new(
show_archived: false,
with_tags: false,
)
res = s.links.count(request: req)
unless res.nil?
# handle response
endimport { Dub } from "dub";
const dub = new Dub({
token: "DUB_API_KEY",
});
async function run() {
const result = await dub.links.count();
console.log(result);
}
run();curl --request GET \
--url https://api.dub.co/links/count \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.dub.co/links/count', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://api.dub.co/links/count")
.header("Authorization", "Bearer <token>")
.asString();123{
"error": {
"code": "bad_request",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#bad-request"
}
}{
"error": {
"code": "unauthorized",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#unauthorized"
}
}{
"error": {
"code": "forbidden",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#forbidden"
}
}{
"error": {
"code": "not_found",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#not-found"
}
}{
"error": {
"code": "conflict",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#conflict"
}
}{
"error": {
"code": "invite_expired",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#invite-expired"
}
}{
"error": {
"code": "unprocessable_entity",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#unprocessable-entity"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#rate-limit_exceeded"
}
}{
"error": {
"code": "internal_server_error",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#internal-server_error"
}
}Authorizations
Default authentication mechanism
Query Parameters
The domain to filter the links by. E.g. ac.me. If not provided, all links for the workspace will be returned.
Deprecated: Use tagIds instead. The tag ID to filter the links by.
The tag IDs to filter the links by.
The unique name of the tags assigned to the short link (case insensitive).
The folder ID to filter the links by.
The search term to filter the links by. The search term will be matched against the short link slug and the destination url.
The user ID to filter the links by.
The ID of the tenant that created the link inside your system. If set, will only return links for the specified tenant.
Whether to include archived links in the response. Defaults to false if not provided.
DEPRECATED. Filter for links that have at least one tag assigned to them.
The field to group the links by.
domain Response
A list of links
The number of links matching the query.