-
Notifications
You must be signed in to change notification settings - Fork 5
/
openapi.yaml
4092 lines (4049 loc) · 138 KB
/
openapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.0
info:
title: Version 4 of the BL.INK API
description: >-
# Introduction
This is version 4 of the BL.INK API. It follows common REST patterns.
[Download a Postman file](https://blink.engineer/postman) to help you get
gain knowledge of our API. Learn more about [Postman Desktop
App](https://www.postman.com/downloads/).
**NOTE: This version of tha API is exactly like v3 with responses that are
more consistent.
Docs for v3 can be found at: https://developers.bl.ink/api-v3.html
Endpoints that have changed include Get Link, Create Link, and Update Link,
and Validate Link, and Create Tag.
Please test the responses before using in production systems.**
API PRIMARY BASE URL
https://app.bl.ink/api/v4
Note: Enterprise customers must use the admin panel domain in place of
https://app.bl.ink.
Please use SSL (https) for all requests.
All API calls are subject to a rate limit of 5 connections per second per IP
address. All requests exceeding that limitation will receive an HTTP 533,
HTTP 544, or HTTP 503 (Service Temporarily Unavailable).
# Authentication
All endpoints require a valid access token for authentication:
1. Invoke the ```POST /access_token``` endpoint to get a new access_token
1. Add the following header to all endpoint requests:
```Authorization: Bearer <access_token>```
If you see a refresh token in your BL.INK UI, use that to get a new
access_token
There are two types of tokens, access and refresh token. An access token is
used with each api call to verify the user. A user requests an access token
with either their username and password, or their username and their refresh
token. An access token expires after 24 hours. Our api end point to retrieve
an access token will always return a valid access token so the user doesn't
need to keep track of expiration.
If you would rather not supply your password to receive an access token, you
may use the refresh token instead..
# Client
To generate client SDK code:
1. Download the OpenApi specification file (above)
1. Follow these instructions: [Swagger Code
Generation](https://swagger.io/docs/swagger-tools/#swagger-codegen-documentation-9)
version: 4.0.0
contact:
name: API Support
url: https://help.bl.ink
email: help@bl.ink
x-logo:
url: /includes/img/blink-60.png
x-api-status-urls: false
x-konfig-ignore:
object-with-no-properties: true
servers:
- url: https://{instance}.bl.ink/api/v4
variables:
instance:
description: Subdomain that an instance of BL.INK has been installed on.
default: app
tags:
- name: Tags
- description: Validate Customer Login Credentials
name: Validate Login
- description: Create Access Token
name: Access Token
- description: List Users
name: List Users
- description: Create Branded Link or BL.INK Link
name: Create Link
- description: Update Link
name: Update Link
- description: List Links
name: List Links
- description: List Clicked Links
name: List Clicked Links
- description: Searches to find a link with a given alias.
name: Get Link By Alias
- description: Once a link is created you may retrieve it in the form of a QR code.
name: Retrieve QR Code
- description: List Domains
name: List Domains
- description: Get Domain by ID
name: Get Domain by ID
- description: Create Domain
name: Create Domain
- description: Update Domain
name: Update Domain
- description: Delete Domain
name: Delete Domain
- description: List UTM Templates
name: List UTM Templates
- description: List Groups
name: List Groups
- description: List link count per day
name: Domain Click Count Per Day
- description: List link count per country
name: Domain Click Count Per Country
- description: List link count per region
name: Domain Click Count Per Region
- description: List link count per city
name: Domain Click Count Per City
- description: List link count per device
name: Domain Click Count Per Device
- description: List link count per referrer
name: Domain Click Count Per Referrer
- description: List link count(s)
name: Link Click Count
- description: List link count per hour
name: Link Click Count Per Hour
- description: List link count per day
name: Link Click Count Per Day
- description: List link count per country
name: Link Click Count Per Country
- description: List link count per region
name: Link Click Count Per Region
- description: List link count per city
name: Link Click Count Per City
- description: List link count per device
name: Link Click Count Per Device
- description: List link count per referrer
name: Link Click Count Per Referrer
- description: List link raw clicks
name: Link Raw Clicks
- description: List of all the error codes that can be returned
name: Error Codes
- name: Validate Link
- name: Get Link
- name: Get Domain by Domain Name
- description: Authentication
name: Authentication
- description: Links
name: Links
- description: Domains
name: Domains
- description: UTM Templates
name: UTM Templates
- description: Groups
name: Groups
- description: Miscellaneous
name: Misc
paths:
/validate_login:
post:
tags:
- Validate Login
summary: Validates login information
operationId: ValidateLogin_information
description: Validates login information
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CredentialsEmailPassword'
responses:
'200':
description: Successfully validated that the username and password are correct
content:
application/json:
schema:
$ref: '#/components/schemas/ValidateLoginInformationResponse'
'401':
description: The input auth data was invalid
content:
application/json:
schema:
$ref: '#/components/schemas/InvalidAuthError'
/access_token:
post:
tags:
- Access Token
summary: Returns a valid authentication token
operationId: AccessToken_generateToken
description: |2-
Returns a valid authentication token. When requesting a token it will return an existing not-expired token. If an existing expired token exists, it will generate a new token and return that.
This will accept either a password for the account or a refresh token.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AccessTokenGenerateTokenRequest'
responses:
'200':
description: A valid token should have been returned
content:
application/json:
schema:
$ref: '#/components/schemas/AccessTokenGenerateTokenResponse'
'401':
description: The input auth data was invalid
content:
application/json:
schema:
$ref: '#/components/schemas/InvalidAuthError'
/users:
get:
tags:
- List Users
summary: >-
Returns the users in an account for those who have account admin
authorization.
operationId: ListUsers_byAccountAdmin
responses:
'200':
description: Successfully return total clicks per referrer for a given domain.
content:
application/json:
schema:
$ref: '#/components/schemas/ListUsersByAccountAdminResponse'
/{domain_id}/links:
parameters:
- name: domain_id
in: path
required: true
schema:
type: integer
post:
tags:
- Create Link
summary: Will take the passed in URL and create a new shortened link.
operationId: CreateLink_shortenedUrl
description: >-
Will take the passed in URL and create a new shortened link based on the
parameters that are passed in.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateLinkShortenedUrlRequest'
responses:
'200':
description: Successfully created the short link using passed in parameters
content:
application/json:
schema:
$ref: '#/components/schemas/CreateLinkShortenedUrlResponse'
links:
GetDomainByDomainId:
$ref: '#/components/links/GetDomainByDomainId'
'400':
description: The input data was invalid
content:
application/json:
schema:
$ref: '#/components/schemas/InvalidDataError'
get:
tags:
- List Links
summary: Returns a list of user's links filtering by query params
operationId: ListLinks_byQueryParams
description: >-
Searches for all links matching the query parameters that belong to the
API user
parameters:
- description: The UTC unix timestamp, query returns values after this date.
name: from_unix
in: query
required: false
schema:
type: integer
- description: >-
The UTC unix timestamp, query returns values before this date.
Required if from_unix is specified.
name: to_unix
in: query
required: false
schema:
type: integer
- description: Search links by tag
name: tag
in: query
required: false
schema:
type: string
- description: Search link alias, notes, and redirect url for keyword
name: keyword
in: query
schema:
type: string
- description: Page number
name: page
in: query
schema:
type: integer
- description: long URL to search links by
name: url
in: query
schema:
type: string
- description: >-
Orders results differently. Possible values 'oldest' or 'latest'.
Defaults to 'oldest'
name: order
in: query
schema:
type: string
- description: Search links by group_id
name: group_id
in: query
schema:
type: integer
- description: >-
A flag for privileged users (domain admins or account admins) to
specify returning all links from corresponding domain instead of
just links they created. Example users=all
name: users
in: query
schema:
type: string
responses:
'200':
description: Successfully return a list of links
content:
application/json:
schema:
$ref: '#/components/schemas/ListLinksByQueryParamsResponse'
'400':
description: The input data was invalid
content:
application/json:
schema:
$ref: '#/components/schemas/InvalidDataError'
/{domain_id}/links/clicked?tag={tag}:
get:
tags:
- List Clicked Links
summary: >-
Returns links clicked on within a specified time range as well as the
number of clicks (lifetime and within range)
operationId: ListClickedLinks_withinTimeframe
description: >-
(**Team, Business, and Enterprise Only**) This endpoint retrieves the
links that have been clicked within a specified timeframe. A user with
elevated privileges automatically queries all user's links under the
domain and must use the 'from_user' flag to specify themselves. See
request parameters. A user without these privileges will only be able to
query their own links. A domain ID must be specified in the URL. You may
provide a timestamp range as well as a page number. The timestamp is
assumed to be in UTC format and follow unix standards. The max time
period allowed to query is a year. If no timestamp range is set, the
output will return any links clicked from a week ago til today. If only
the starting timestamp is set, the result will be the clicked links
from a year ahead of starting timestamp. The ending timestamp cannot be
specified on its own without a starting timestamp. The range cannot
exceed a year at a time. The page defaults to 1 with a max number of
results set to a predefined number 50. **The click count is retrieved
from a cached instance and therefore does not represent the real-time
total**. Results are sorted by most clicked.
parameters:
- description: The unique domain identifier.
name: domain_id
in: path
required: true
schema:
type: integer
- description: The UTC unix timestamp, query returns values after this date.
name: from_unix
in: query
required: false
schema:
type: integer
- description: >-
The UTC unix timestamp, query returns values before this date.
Required if from_unix is specified.
name: to_unix
in: query
required: false
schema:
type: integer
- description: >-
An optional parameter. Valid value 'me' is allowed to only query for
your links.
name: from_user
in: query
required: false
schema:
- type: string
- description: Search link alias, notes, and redirect url for keyword
name: keyword
in: query
schema:
type: string
- description: >-
The page of to query the values from the paginated results. Defaults
to 1.
name: page
in: query
required: false
schema:
type: integer
- description: Search links by tag
name: tag
in: query
required: false
schema:
type: string
- description: Search links by group_id
name: group_id
in: query
required: false
schema:
type: integer
responses:
'200':
description: Successfully return total clicks per referrer for a given domain.
content:
application/json:
schema:
$ref: '#/components/schemas/ListClickedLinksWithinTimeframeResponse'
/links/validate:
post:
tags:
- Validate Link
summary: Will take the passed in URL and validate it.
operationId: ValidateLink_url
description: Will take the passed in URL and validate it.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ValidateLinkUrlRequest'
responses:
'200':
description: The URL is valid
content:
application/json:
schema:
$ref: '#/components/schemas/ValidateLinkUrlResponse'
'400':
description: The input data was invalid
content:
application/json:
schema:
$ref: '#/components/schemas/InvalidDataError'
/{domain_id}/links/{link_id}:
parameters:
- name: domain_id
in: path
required: true
schema:
type: integer
- name: link_id
in: path
required: true
schema:
type: integer
get:
tags:
- Get Link
summary: Returns a short link
operationId: GetLink_shortenedLink
description: >-
Returns a short link. Each short link has a corresponding domain it
belongs to and and individual id.
responses:
'200':
description: Successfully returned a short link.
content:
application/json:
schema:
$ref: '#/components/schemas/GetLinkShortenedLinkResponse'
patch:
tags:
- Update Link
summary: Takes a series of change operations and applies them to the link
operationId: UpdateLink_withChanges
description: >-
Will take an array of objects defining operations to be performed. This
is based on the JSON patch format as defined in [RFC
6902](https://tools.ietf.org/html/rfc6902).
# Supported Operations:
- replace
# Supported paths:
- /alias
- /url
- /notes
- /notify_on_click
- /delete_on
- /archive_on
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateLinkWithChangesRequest'
responses:
'200':
description: Successfully modified the link
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateLinkWithChangesResponse'
'400':
description: The input data was invalid
content:
application/json:
schema:
$ref: '#/components/schemas/InvalidDataError'
/{domain_id}/links/exists?alias={alias}:
parameters:
- name: domain_id
in: path
required: true
schema:
type: integer
- name: alias
in: query
required: true
schema:
type: string
get:
tags:
- Get Link By Alias
summary: Returns a short link by the given alias
operationId: GetLinkByAlias_shortenedUrl
description: >-
Returns a short link. Each short link has a corresponding domain it
belongs to and the provided.
responses:
'200':
description: Successfully returned a short link.
content:
application/json:
schema:
$ref: '#/components/schemas/GetLinkByAliasShortenedUrlResponse'
/{domain_id}/links/{link_id}/qr:
parameters:
- name: domain_id
in: path
required: true
schema:
type: integer
- name: link_id
in: path
required: true
schema:
type: integer
- description: png (default), eps, svg
name: format
in: query
required: false
schema:
type: string
get:
tags:
- Retrieve QR Code
summary: Retrieve link in QR form
operationId: RetrieveQrCode_forLink
description: >-
Returns QR data for specified link, domain in the specified format. The
API will return the image data in binary format.
responses:
'200':
description: Successfully returned a short link.
content:
image/png:
schema:
$ref: '#/components/schemas/RetrieveQrCodeForLinkResponse'
image/svg:
schema:
$ref: '#/components/schemas/RetrieveQrCodeForLink200Response'
image/eps:
schema:
$ref: '#/components/schemas/RetrieveQrCodeForLink200Response'
'400':
description: The input data was invalid
content:
application/json:
schema:
$ref: '#/components/schemas/InvalidDataError'
'401':
description: The input auth data was invalid
content:
application/json:
schema:
$ref: '#/components/schemas/UnauthorizedError'
/{domain_id}/clicks/daily:
get:
tags:
- Domain Click Count Per Day
summary: Returns the domain click count for each day.
operationId: DomainClickCountPerDay_getCountByDay
description: >-
(**Team, Business, and Enterprise Only**) This endpoint retrieves the
total clicks made on a domain grouped by days. A domain ID must be
specified in the URL. Optionally, you may provide a timestamp range as
well as a page number. The timestamp is assumed to be in UTC format and
follow unix standards. The max time period allowed to query is a year.
If no timestamp range is set, the output will be the total count from a
week ago til today. If only the starting timestamp is set, the result
will be the counts from a year ahead of starting timestamp. The ending
timestamp cannot be specified on its own without a starting timestamp.
The range cannot exceed a year at a time. The page defaults to 1 with a
max number of results set to a predefined number 50. The counts are
retrieved from a cached instance and therefore does not represent the
real-time total but comes close. Result are sorted by day.
parameters:
- description: The unique domain identifier.
name: domain_id
in: path
required: true
schema:
type: integer
- description: The UTC unix timestamp, query returns values after this date.
name: from_unix
in: query
required: false
schema:
type: integer
- description: >-
The UTC unix timestamp, query returns values before this date.
Required if from_unix is specified.
name: to_unix
in: query
required: false
schema:
type: integer
- description: >-
An optional parameter containing the user's ID to query. Elevated
privileges are required to specify another. Defaults to current
user. Valid value 'all' is allowed for users of elevated privileges.
name: user_id
in: query
required: false
schema:
oneOf:
- type: string
- type: integer
- description: An optional parameter containing the label's ID to query.
name: label_id
in: query
required: false
schema:
oneOf:
- type: string
- type: integer
- description: Search link alias, notes, and redirect url for keyword
name: keyword
in: query
schema:
type: string
- description: The page of to query the values from the paginated results.
name: page
in: query
required: false
schema:
type: integer
responses:
'200':
description: Successfully return the daily total clicks for a given domain.
content:
application/json:
schema:
$ref: >-
#/components/schemas/DomainClickCountPerDayGetCountByDayResponse
/{domain_id}/clicks/country:
get:
tags:
- Domain Click Count Per Country
summary: Returns the total click count per country.
operationId: DomainClickCountPerCountry_getTotalCountsByCountry
description: >-
(**Team, Business, and Enterprise Only**) This endpoint retrieves the
total clicks made on a domain grouped by country. A domain ID must be
specified in the url with the option to set a timestamp range and a
page to retrieve the paginated results. If the timestamp range exceeds a
day the hour The timestamp is assumed to be in UTC format and follow
unix standards. The max time period allowed to query is a year. If no
timestamp range is set, the output will be the total count from a week
ago til today. If only the starting timestamp is set, the result will be
the counts from a year ahead of starting timestamp. The ending
timestamp cannot be specified on its own without a starting timestamp.
The range cannot exceed a year at a time. The page defaults to 1 with a
max number of results set to a predefined number 50. The count is
retrieved from a cached instance and therefore does not represent the
real-time total. Results are sorted by popularity then by country.
parameters:
- description: The unique domain identifier.
name: domain_id
in: path
required: true
schema:
type: integer
- description: The UTC unix timestamp, query returns values after this date.
name: from_unix
in: query
required: false
schema:
type: integer
- description: >-
The UTC unix timestamp, query returns values before this date.
Required if from_unix is specified.
name: to_unix
in: query
required: false
schema:
type: integer
- description: >-
An optional parameter containing the user's ID to query. Elevated
privileges are required to specify another. Defaults to current
user. Valid value 'all' is allowed for users of elevated privileges.
name: user_id
in: query
required: false
schema:
oneOf:
- type: string
- type: integer
- description: An optional parameter containing the label's ID to query.
name: label_id
in: query
required: false
schema:
oneOf:
- type: string
- type: integer
- description: Search link alias, notes, and redirect url for keyword
name: keyword
in: query
schema:
type: string
- description: The country to query the values
name: country
in: query
required: false
schema:
type: string
- description: The page of to query the values from the paginated results.
name: page
in: query
required: false
schema:
type: integer
responses:
'200':
description: Successfully return total clicks per country for a given domain.
content:
application/json:
schema:
$ref: >-
#/components/schemas/DomainClickCountPerCountryGetTotalCountsByCountryResponse
/{domain_id}/clicks/region:
get:
tags:
- Domain Click Count Per Region
summary: Returns the total click count per region.
operationId: DomainClickCountPerRegion_getByRegion
description: >-
(**Team, Business, and Enterprise Only**) This endpoint retrieves the
total clicks made on a domain grouped by region. A domain ID must be
specified in the url with the option to set a timestamp range and a
page to retrieve the paginated results. If the timestamp range exceeds a
day the hour The timestamp is assumed to be in UTC format and follow
unix standards. The max time period allowed to query is a year. If no
timestamp range is set, the output will be the total count from a week
ago til today. If only the starting timestamp is set, the result will be
the counts from a year ahead of starting timestamp. The ending
timestamp cannot be specified on its own without a starting timestamp.
The range cannot exceed a year at a time. TThe page defaults to 1 with
a max number of results set to a predefined number 50. The count is
retrieved from a cached instance and therefore does not represent the
real-time total. Results are sorted by popularity then by country and
region.
parameters:
- description: The unique domain identifier.
name: domain_id
in: path
required: true
schema:
type: integer
- description: The UTC unix timestamp, query returns values after this date.
name: from_unix
in: query
required: false
schema:
type: integer
- description: >-
The UTC unix timestamp, query returns values before this date.
Required if from_unix is specified.
name: to_unix
in: query
required: false
schema:
type: integer
- description: >-
An optional parameter containing the user's ID to query. Elevated
privileges are required to specify another. Defaults to current
user. Valid value 'all' is allowed for users of elevated privileges.
name: user_id
in: query
required: false
schema:
oneOf:
- type: string
- type: integer
- description: An optional parameter containing the label's ID to query.
name: label_id
in: query
required: false
schema:
oneOf:
- type: string
- type: integer
- description: Search link alias, notes, and redirect url for keyword
name: keyword
in: query
schema:
type: string
- description: The country to query the values
name: country
in: query
required: false
schema:
type: string
- description: The region to query the values
name: region
in: query
required: false
schema:
type: string
- description: The page of to query the values from the paginated results.
name: page
in: query
required: false
schema:
type: integer
responses:
'200':
description: Successfully return total clicks per region for a given domain.
content:
application/json:
schema:
$ref: >-
#/components/schemas/DomainClickCountPerRegionGetByRegionResponse
/{domain_id}/clicks/city:
get:
tags:
- Domain Click Count Per City
summary: Returns the total click count per city.
operationId: DomainClickCountPerCity_getTotalClickCountPerCity
description: >-
(**Team, Business, and Enterprise Only**) This endpoint retrieves the
total clicks made on a domain grouped by city. A domain ID must be
specified in the url with the option to set a timestamp range and a
page to retrieve the paginated results. If the timestamp range exceeds a
day the hour The timestamp is assumed to be in UTC format and follow
unix standards. The max time period allowed to query is a year. If no
timestamp range is set, the output will be the total count from a week
ago til today. If only the starting timestamp is set, the result will be
the counts from a year ahead of starting timestamp. The ending
timestamp cannot be specified on its own without a starting timestamp.
The range cannot exceed a year at a time. The page defaults to 1 with a
max number of results set to a predefined number 50. The count is
retrieved from a cached instance and therefore does not represent the
real-time total. Results are sorted by popularity then by country,
region, and city.
parameters:
- description: The unique domain identifier.
name: domain_id
in: path
required: true
schema:
type: integer
- description: The UTC unix timestamp, query returns values after this date.
name: from_unix
in: query
required: false
schema:
type: integer
- description: >-
The UTC unix timestamp, query returns values before this date.
Required if from_unix is specified.
name: to_unix
in: query
required: false
schema:
type: integer
- description: >-
An optional parameter containing the user's ID to query. Elevated
privileges are required to specify another. Defaults to current
user. Valid value 'all' is allowed for users of elevated privileges.
name: user_id
in: query
required: false
schema:
oneOf:
- type: string
- type: integer
- description: An optional parameter containing the label's ID to query.
name: label_id
in: query
required: false
schema:
oneOf:
- type: string
- type: integer
- description: Search link alias, notes, and redirect url for keyword
name: keyword
in: query
schema:
type: string
- description: The country to query the values
name: country
in: query
required: false
schema:
type: string
- description: The region to query the values
name: region
in: query
required: false
schema:
type: string
- description: The city to query the values
name: city
in: query
required: false
schema:
type: string
- description: The page of to query the values from the paginated results.
name: page
in: query
required: false
schema:
type: integer
responses:
'200':
description: Successfully return total clicks per city for a given domain.
content:
application/json:
schema:
$ref: >-
#/components/schemas/DomainClickCountPerCityGetTotalClickCountPerCityResponse
/{domain_id}/clicks/device:
get:
tags:
- Domain Click Count Per Device
summary: Returns the total click count per device.
operationId: DomainClickCountPerDevice_getTotalClicksPerDevice
description: >-
(**Team, Business, and Enterprise Only**) This endpoint retrieves the
total clicks made on a domain grouped by device. A domain ID must be
specified in the url with the option to set a timestamp range and a
page to retrieve the paginated results. If the timestamp range exceeds a
day the hour The timestamp is assumed to be in UTC format and follow
unix standards. The max time period allowed to query is a year. If no
timestamp range is set, the output will be the total count from a week
ago til today. If only the starting timestamp is set, the result will be
the counts from a year ahead of starting timestamp. The ending
timestamp cannot be specified on its own without a starting timestamp.
The range cannot exceed a year at a time. The page defaults to 1 with a
max number of results set to a predefined number 50. The count is
retrieved from a cached instance and therefore does not represent the
real-time total. Results are sorted by popularity then by device.
parameters:
- description: The unique domain identifier.
name: domain_id
in: path
required: true
schema:
type: integer
- description: The UTC unix timestamp, query returns values after this date.
name: from_unix
in: query
required: false
schema:
type: integer