-
Notifications
You must be signed in to change notification settings - Fork 40
/
apiary.apib
1728 lines (1608 loc) · 58.7 KB
/
apiary.apib
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
HOST: https://secure.gooddata.com/gdc
--- GoodData API Documentation ---
---
GoodData API is based on REST principles, all you need to use it is your GoodData account. You have to be authenticated and call the simple HTTPs request on the URL specified below.
The following documentation covers core resources that are used to manipulate with the main entities. First of all, read basic instructions to start using the API.
`Please use only your GoodData testing account credentials with the Apiary.io tool`
##Allowed HTTPs requests:
POST : To create or update resource
GET : Get a resource or list of resources
DELETE : To delete resource
##Description Of Usual Server Responses
- 200 `OK` - the request was successful (some API calls may return 201 instead).
- 201 `Created` - the request was successful and a resource was created.
- 204 `No Content` - the request was successful but there is no representation to return (i.e. the response is empty).
- 400 `Bad Request` - the request could not be understood or was missing required parameters.
- 401 `Unauthorized` - authentication failed or user doesn't have permissions for requested operation.
- 403 `Forbidden` - access denied.
- 404 `Not Found` - resource was not found
- 405 `Method Not Allowed` - requested method is not supported for resource.
---
--
Login
To login into the GoodData API, use following calls.
1. `POST` your credentials to the login resource in JSON body
2. **SST Token** is returned back in SetCookie header
3. `GET` the token resource with **SST Token** in your header to receive **TT Token**
4. Use the **TT Token** in your API calls header: -cookie
`Remember` that TT Token has **limited validity**. Once you received 401 Unauthorized Response, you need to GET new TT Token in following resource with SST Token specified in call header.
###Login Properties
- login (string) : User's email
- password (string) : User's password
- remember (boolean) : Remember user login
--
This resource is the first. Use it to log into the API.
`Please use only your GoodData testing account credentials with the Apiary.io tool`
POST /account/login
> Content-Type: application/json
> Accept: application/json
{"postUserLogin":{"login":"[email protected]","password":"YourPassword","remember":1}}
< 201
< Content-Type: application/json
< Set-Cookie: GDCAuthTT=; path=/gdc; expires=Mon, 30-Jul-2012 09:12:42 GMT; secure; HttpOnly, GDCAuthSST={super-secured-token}; path=/gdc/account; secure; HttpOnly
{"userLogin":{"profile":"/gdc/account/profile/USER-ID","state":"/gdc/account/login/USER-ID"}}
GET /account/profile/{user-id}
> Content-Type: application/json
> Accept: application/json
< 200
< Content-Type: application/json
You'll get the authentication token on this resource.
GET /account/token
> Content-Type: application/json
> Accept: application/json
> Cookie: $Version=0; GDCAuthSST={super-secured-token}; $Path=/gdc/account
< 200
< Content-Type: application/json
< Set-Cookie: set-cookie: GDCAuthTT={temporary-token}; path=/gdc; secure; HttpOnly
For logout the user
DELETE /account/{user-id}
> Content-Type: application/json
> Accept: application/json
< 200
< Content-Type: application/json
--
Project
Project is one of the key entities inside GoodData. When working with GoodData, you basically create analytical projects (datamarts). Metrics, Reports and Dashboards
are then created inside Projects.
###Project Properties
- title (string) : Project Title
- summary (string) : Project summary
- roles (uri) : User's role in the Project
- userPermissions (uri) : User permissions information
- userRoles (uri) : User roles information
- users (uri) : Project users information
- created (date) : Date of project creation
- updated (date) : Date of project update
- author (uri) : Project creator account
- exportUsers (boolean) : export users from project true/false
- exportData (boolean) : export data from project true/false
- token (string) : export Token for export/import project usage
--
To create new project, use following call. Poll the resource that you received as response until it gives you the status: **Enabled**
See the next API call for more details. You can create PostgreSQL based Project, which is stil in beta version.
POST /projects
> Content-Type: application/json
> Accept: application/json
{ "project" : {
"content" : { "guidedNavigation": 1, "driver" : "Pg", "authorizationToken" : "AUTH_TOKEN"},
"meta" : {
"title" : "Test Project",
"summary" : "Testing Project"
} }
}
< 201
< Content-Type: application/json
{
"uri" : "/gdc/projects/TEST_PROJECT_ID"
}
To show the Project information after creation or whenever you need it. Use this API request.
GET /projects/{project-id}
> Content-Type: application/json
> Accept: application/json
< 200
< Content-Type: application/json
{
"project" : {
"content" : {
"guidedNavigation" : "1",
"isPublic" : "0",
"state" : "ENABLED"
},
"links" : {
"roles" : "/gdc/projects/Project2/roles",
"ldm_thumbnail" : "/gdc/projects/Project2/ldm?thumbnail=1",
"connectors" : "/gdc/projects/Project2/connectors",
"self" : "/gdc/projects/Project2",
"invitations" : "/gdc/projects/Project2/invitations",
"users" : "/gdc/projects/Project2/users",
"ldm" : "/gdc/projects/Project2/ldm",
"publicartifacts" : "/gdc/projects/Project2/publicartifacts",
"metadata" : "/gdc/md/Project2",
"templates" : "/gdc/md/Project2/templates"
},
"meta" : {
"created" : "2012-05-01 23:56:01",
"summary" : "Quotes",
"updated" : "2012-05-01 23:56:01",
"author" : "/gdc/account/profile/17",
"title" : "Quotes",
"contributor" : "/gdc/account/profile/17"
}
}
}
To list all existing projects
GET /account/profile/{profile-id}/projects
> Content-Type: application/json
> Accept: application/json
< 200
< Content-Type: application/json
{
"projects" : [
{
"project" : {
"content" : {
"guidedNavigation" : "1",
"isPublic" : "0",
"state" : "ENABLED"
},
"links" : {
"roles" : "/gdc/projects/PROJECT_ID/roles",
"ldm_thumbnail" : "/gdc/projects/PROJECT_ID/ldm?thumbnail=1",
"userPermissions" : "/gdc/projects/PROJECT_ID_/users/PROFILE_ID/permissions",
"userRoles" : "/gdc/projects/PROJECT_ID/users/PROFILE_ID/roles",
"connectors" : "/gdc/projects/PROJECT_ID/connectors",
"self" : "/gdc/projects/PROJECT_ID",
"invitations" : "/gdc/projects/PROJECT_ID/invitations",
"users" : "/gdc/projects/PROJECT_ID/users",
"ldm" : "/gdc/projects/PROJECT_ID/ldm",
"metadata" : "/gdc/md/PROJECT_ID",
"publicartifacts" : "/gdc/projects/PROJECT_ID/publicartifacts",
"templates" : "/gdc/md/PROJECT_ID/templates"
},
"meta" : {
"created" : "YYYY-MM-DD HH:MM:SS",
"summary" : "Project Summary",
"updated" : "YYYY-MM-DD HH:MM:SS",
"author" : "/gdc/account/profile/PROFILE_ID",
"title" : "Your Project Name",
"contributor" : "/gdc/account/profile/PROFILE_ID"
}
}
} ]
}
To Export selected Project - exportUsers and exportData field are not mandatory
POST /md/{project-id}/maintenance/export
> Content-Type: application/json
> Accept: application/json
{ "exportProject" : {
"exportUsers" : "1 | 0",
"exportData" : "1 | 0"
}
}
< 200
< Content-Type: application/json
{
"exportArtifact" : {
"status" : {
"uri" : "/gdc/md/PROJECT_ID/etltask/TASK_ID"
},
"token" : "EXPORT_TOKEN"
}
}
Use this method to import exported Project
POST /md/{project-id}/maintenance/import
> Content-Type: application/json
> Accept: application/json
{
"importProject" : {
"token" : "TOKEN_STRING"
}
}
< 200
< Content-Type: application/json
{
"uri" : "/gdc/md/PROJECT_ID/etltask/TASK_ID"
}
To create your own custom colour palette in given Project
PUT /projects/{project-id}/styleSettings
> Content-Type: application/json
> Accept: application/json
{"styleSettings" :
{"chartPalette": [
{ "guid": "guid1", "fill": { "r":255, "g":255, "b":0 } },
{ "guid": "guid2", "fill": { "r":255, "g":255, "b":40 } },
{ "guid": "guid3", "fill": { "r":255, "g":255, "b":80 } },
{ "guid": "guid4", "fill": { "r":255, "g":255, "b":120 } },
{ "guid": "guid5", "fill": { "r":255, "g":255, "b":180 } },
{ "guid": "guid6", "fill": { "r":255, "g":255, "b":200 } }
]
}
}
< 200
< Content-Type: application/json
{"styleSettings" :
{"chartPalette": [
{ "guid": "guid1", "fill": { "r":255, "g":255, "b":0 } },
{ "guid": "guid2", "fill": { "r":255, "g":255, "b":40 } },
{ "guid": "guid3", "fill": { "r":255, "g":255, "b":80 } },
{ "guid": "guid4", "fill": { "r":255, "g":255, "b":120 } },
{ "guid": "guid5", "fill": { "r":255, "g":255, "b":180 } },
{ "guid": "guid6", "fill": { "r":255, "g":255, "b":200 } }
]
}
}
To Delete/Reset your own custom colour palette in given Project
DELETE /projects/{project-id}/styleSettings
> Content-Type: application/json
> Accept: application/json
< 204
< Content-Type: application/json
--
User
To manage users via the User Provisioning API Resources, you need to have your own domain. If you have it, you can simply use the requests below.
###User Properties
- login (string) : User login
- password (string) : User password
- verifyPassword (string) : Password for verification
- email : User's email for invitations, used as contact email
- firstname (string) : User's firstname
- lastname (string) : User's lastname
- status : User's status, can be Enabled or Disabled
- userRoles (uri) : Uri to the specific user roles
- projectUsersUpdateResult : Give an array of successful/failed created users
- companyName (string) : Name of user's company
- country (string) : User's country
- created (date) : Date of user creation
- updated (date) : Date of user properties update
- phoneNumber : User's phonenumber
- position (string) : User's position in a company
--
To create new user in your domain - use this resource. The API will give you new user's uri. You have to be DOMAIN admin for provision the user to the Project.
POST /account/domains/{domain-name}/users
> Content-Type: application/json
> Accept: application/json
{
"accountSetting":{
"login": "[email protected]",
"password":"PASSWORD",
"email":"[email protected]",
"verifyPassword":" PASSWORD ",
"firstName":"FirstName",
"lastName":"LastName",
"ssoProvider":"SSO-PROVIDER"
}
}
< 200
< Content-Type: application/json
{
"uri" : "/gdc/account/profile/{profile-id}"
}
To add created User to the Project. User roles are defined by ID:
5 - readOnlyUserRole
4 - dashboardOnlyRole
3 - adminRole
2 - editorRole
1 - unverifiedAdminRole
POST /projects/{project-id}/users
> Content-Type: application/json
> Accept: application/json
{ "user" : {
"content" : {
"status":"ENABLED",
"userRoles":["/gdc/projects/{project-id}/roles/{role-id}"]
},
"links" : {
"self":"/gdc/account/profile/{user-id}"
}
}
}
< 200
< Content-Type: application/json
{"projectUsersUpdateResult":{
"successful":["/gdc/account/profile/{profile-id}"],
"failed":[]}
}
Use this resource for invite user to the Project. The invotation email will be sent.
POST /projects/{project-id}/invitations
> Content-Type: application/json
> Accept: application/json
{
"invitations": [
{
"invitation": {
"content": {
"email": "[email protected]",
"role": "/gdc/projects/{project-id}/roles/{role-id}",
"firstname": "firstname",
"lastname": "lastname",
"action": {
"setMessage": "You can set message here!"
}
}
}
}
]
}
< 200
< Content-Type: application/json
{
"createdInvitations": {
"uri": [
"/gdc/projects/{project-id}/invitations/{invitation-id}"
]
}
}
Lists all users in a domain
GET /account/domains/{domain-name}/users
> Content-Type: application/json
> Accept: application/json
< 200
< Content-Type: application/json
{
"accountSettings": {
"paging": {
"offset": 0,
"count": 14
},
"items": [
{
"accountSetting": {
"companyName": "Company",
"country": "cz",
"created": "2011-08-10 08:37:46",
"firstName": "John",
"lastName": "Doe",
"login": "[email protected]",
"ssoProvider":"SSO-PROVIDER",
"phoneNumber": "+420724722926",
"position": "",
"settings": "{\"_VERSION\":\"1.1\",\"currentProjectUri\":\"/gdc/projects/{project-id}\",\"/gdc/projects/5znhmmxxrzjan0r2p1v7ofycdsrx0264\":{\"dashboard\":[\"/gdc/md/5znhmmxxrzjan0r2p1v7ofycdsrx0264/obj/15091\",\"aF3FJYXegmp7\"]},\"releaseNotice\":[\"stable_67\"],\"/gdc/projects/ca6a1r1lbfwpt2v05k36nbc0cjpu7lh9\":{\"dashboard\":[\"/gdc/md/ca6a1r1lbfwpt2v05k36nbc0cjpu7lh9/obj/200001988\",\"azBgmCJJe0mc\"]},\"/gdc/projects/uikbr0t694tnh3uje22yedukbyzyt30o\":{\"dashboard\":[\"/gdc/md/uikbr0t694tnh3uje22yedukbyzyt30o/obj/923\",\"aezS8TwAcGHp\"]},\"/gdc/projects/rgxvsmz1p995jek9ul9tlmpf6t58smrc\":{\"dashboard\":[\"/gdc/md/rgxvsmz1p995jek9ul9tlmpf6t58smrc/obj/3077\",\"akr9OnQ1eOm4\"]},\"hint-projectPage-invite-people\":false,\"/gdc/projects/j41cf2ph664i24r06zvj4f8rcpwoc7z5\":{\"dashboard\":[\"/gdc/md/j41cf2ph664i24r06zvj4f8rcpwoc7z5/obj/302\",\"acuSDRVTfsy9\"]},\"/gdc/projects/aroa0dpcaw7qde90zk28qe1g8a9yiduc\":{\"dashboard\":[\"/gdc/md/aroa0dpcaw7qde90zk28qe1g8a9yiduc/obj/1934\",\"aThZ8kBxhhOD\"]},\"/gdc/projects/als9uzqw5b3mmedep20dz079gu4l2ts4\":{\"dashboard\":[\"/gdc/md/als9uzqw5b3mmedep20dz079gu4l2ts4/obj/255\",\"acuSDRVTfsy9\"]},\"/gdc/projects/e40dze1gsyuzbiw6uo7pezb172za0g6t\":{\"dashboard\":[\"/gdc/md/e40dze1gsyuzbiw6uo7pezb172za0g6t/obj/878\",\"amDMbVxHiEpT\"]},\"/gdc/projects/qdi4csdu3cncw7cl6ytw0c08ezhjiacl\":{\"dashboard\":[\"/gdc/md/qdi4csdu3cncw7cl6ytw0c08ezhjiacl/obj/1934\",\"aae2SZzwayQc\"]},\"/gdc/projects/88w3p5nd8tjvvugg71o7alrn95brxd49\":{\"dashboard\":[\"/gdc/md/88w3p5nd8tjvvugg71o7alrn95brxd49/obj/1934\",\"aae2SZzwayQc\"]},\"/gdc/projects/1fm43ndfbq0adk6q44sv6vzjfe2mpzbf\":{\"dashboard\":[\"/gdc/md/1fm43ndfbq0adk6q44sv6vzjfe2mpzbf/obj/302\",\"acuSDRVTfsy9\"]},\"/gdc/projects/z7hy8dgakfovolhmkr0in5gab55eh8sf\":{\"dashboard\":[\"/gdc/md/z7hy8dgakfovolhmkr0in5gab55eh8sf/obj/1134\",\"axbb0wX9hWXt\"]},\"/gdc/projects/0xdgi5rf00ojg3i8buihnce9abcs0jlo\":{\"dashboard\":[\"/gdc/md/0xdgi5rf00ojg3i8buihnce9abcs0jlo/obj/1788\",\"bykyxrVPd4bK\"]},\"/gdc/projects/j411aqhpfwyfhbfcmpgp7wdv2kkadk1h\":{\"dashboard\":[\"/gdc/md/j411aqhpfwyfhbfcmpgp7wdv2kkadk1h/obj/1134\",\"axbb0wX9hWXt\"]},\"/gdc/projects/3j538qu3uaco59yqvy4f67x6r1yp2xcb\":{\"dashboard\":[\"/gdc/md/3j538qu3uaco59yqvy4f67x6r1yp2xcb/obj/928\",\"aejgJwQohyCf\"]},\"/gdc/projects/x0ihh49quilaf0cjm651nnj2hxbmfm3c\":{\"dashboard\":[\"/gdc/md/x0ihh49quilaf0cjm651nnj2hxbmfm3c/obj/1221\",\"aeMPJK0fceaH\"]},\"/gdc/projects/nb8vzlyj8sosxx0myv0tww82j0nosbql\":{\"dashboard\":[\"/gdc/md/nb8vzlyj8sosxx0myv0tww82j0nosbql/obj/975\",\"apcbnqrNem2V\"]},\"/gdc/projects/24ubdyx5m28ojz2fnf34y74vjaxw82r2\":{\"dashboard\":[\"/gdc/md/24ubdyx5m28ojz2fnf34y74vjaxw82r2/obj/4673\",\"akoz8EgNhzEx\"]},\"/gdc/projects/8thc020r46ru5mej90dewtxsdmfdmn9w\":{\"dashboard\":[\"/gdc/md/8thc020r46ru5mej90dewtxsdmfdmn9w/obj/21607\",\"aedRQW1vbS2i\"]},\"/gdc/projects/vs20w6yqnt64jaaw93wlg6osod4w0pew\":{\"dashboard\":[\"/gdc/md/vs20w6yqnt64jaaw93wlg6osod4w0pew/obj/1179\",\"aci3ZI2qg9WA\"]},\"/gdc/projects/fdybuqt6q711dk7fj0hyb17xug4occ7h\":{\"dashboard\":[\"/gdc/md/fdybuqt6q711dk7fj0hyb17xug4occ7h/obj/302\",\"acuSDRVTfsy9\"]},\"/gdc/projects/5c3eynt8oemo1tbg7r18wm1lihsbhi3w\":{\"dashboard\":[\"/gdc/md/5c3eynt8oemo1tbg7r18wm1lihsbhi3w/obj/22383\",\"aafYWrtQicJz\"]},\"/gdc/projects/o1bkm459hl3oqpfvowhc5atm8epum3n8\":{\"dashboard\":[\"/gdc/md/o1bkm459hl3oqpfvowhc5atm8epum3n8/obj/975\",\"apcbnqrNem2V\"]},\"/gdc/projects/u2sgybzl95ezxj06nxvazqryymvhd6xx\":{\"dashboard\":[\"/gdc/md/u2sgybzl95ezxj06nxvazqryymvhd6xx/obj/829\",\"aarQ2wqyh3OO\"]},\"/gdc/projects/ns1tzvr069ufw3gsvgveldbfbh6uyx8u\":{\"dashboard\":[\"/gdc/md/ns1tzvr069ufw3gsvgveldbfbh6uyx8u/obj/975\",\"apcbnqrNem2V\"]},\"/gdc/projects/fe6syz94xsf0n7indc4q4t45bt0ad68f\":{\"dashboard\":[\"/gdc/md/fe6syz94xsf0n7indc4q4t45bt0ad68f/obj/4673\",\"adLaxLMQaQ3s\"]},\"/gdc/projects/fl1tx117xb3qw2ngiuv7prud9a0qsowl\":{\"dashboard\":[\"/gdc/md/fl1tx117xb3qw2ngiuv7prud9a0qsowl/obj/245\",\"aemCHDx1ioL2\"]},\"/gdc/projects/fw1p4xvz8e99g5100wfxymzodatqbmg2\":{\"dashboard\":[\"/gdc/md/fw1p4xvz8e99g5100wfxymzodatqbmg2/obj/4673\",\"aaOGHRxOh0dl\"]},\"/gdc/projects/ic2l94mn960iyy5ycz7dnfz6mhil8php\":{\"dashboard\":[\"/gdc/md/ic2l94mn960iyy5ycz7dnfz6mhil8php/obj/4673\",\"akoz8EgNhzEx\"]},\"/gdc/projects/jusjqe0f5lz3wkpcwxoyyckzclsk2tpy\":{\"dashboard\":[\"/gdc/md/jusjqe0f5lz3wkpcwxoyyckzclsk2tpy/obj/12982\",\"aaGUiXk8hqek\"]}}",
"timezone": null,
"updated": "2012-02-20 16:20:28",
"links": {
"projects": "/gdc/account/profile/19765/projects",
"self": "/gdc/account/profile/19765"
}
}
},
{
"accountSetting": {
"companyName": "",
"country": "",
"created": "2011-11-03 15:16:52",
"firstName": "J",
"lastName": "T",
"login": "[email protected]",
"phoneNumber": "",
"position": "",
"settings": "",
"timezone": null,
"ssoProvider":"SSO-PROVIDER",
"updated": "2011-12-15 14:40:37",
"links": {
"projects": "/gdc/account/profile/25022/projects",
"self": "/gdc/account/profile/25022"
}
}
}
]
}
}
You are able to update the User information
PUT /account/profile/{user-id}
> Content-Type: application/json
> Accept: application/json
{
"accountSetting": {
"firstName": "John",
"lastName": "Doe",
"ssoProvider": "salesforce.com",
"password": "area51x",
"verifyPassword": "area51x"
}
}
< 200
< Content-Type: application/json
To delete User from specific Domain
DELETE /account/profile/{user-id}
> Content-Type: application/json
> Accept: application/json
< 200
< Content-Type: application/json
--
Data Model
The data model is the core concept of GoodData. It can be managed and validated using following API resources. Model is created/managed by using the MAQL language and script.
##Model properties
- maql : MAQL script for creating/updating logical data model
- validateProject : IO - Input/Output, LDM - Logical Data Model, PDM - Physical Data Model
--
To manage Logical Data Model
POST /md/{project-id}/ldm/manage
> Content-Type: application/json
> Accept: application/json
{
"manage" : {
"maql" : "CREATE ATTRIBTE {my_attribute}"
}
}
< 200
< Content-Type: application/json
Use this method to validate Project
POST /md/{project-id}/validate/
> Content-Type: application/json
> Accept: application/json
{ "validateProject" : [ "IO", "LDM", "PDM" ] }
< 201
< Content-Type: application/json
{"uri" : "/gdc/md/PROJECT_ID/validate/TASK_ID"}
Here you can GET the SLI manifest. This manifest is needed to upload your data using the API directly. The SLI manifest provides column mapping between CSV file and data model.
GET /md/{project-id}/ldm/singleloadinterface/{dataset-name}/manifest
> Content-Type: application/json
> Accept: application/json
< 200
< Content-Type: application/json
{
"dataSetSLIManifest": {
"parts": [
{
"columnName": "f_quotes.dt_quote_date_id",
"populates": [
"quote.date.mdyy"
],
"mode": "FULL",
"referenceKey": 1
},
{
"columnName": "d_quotes_sector.nm_sector",
"populates": [
"label.quotes.sector"
],
"mode": "FULL",
"referenceKey": 1
},
{
"columnName": "d_quotes_market.nm_market",
"populates": [
"label.quotes.market"
],
"mode": "FULL",
"referenceKey": 1
},
{
"columnName": "f_quotes.f_low_price",
"populates": [
"fact.quotes.low_price"
],
"mode": "FULL"
},
{
"columnName": "f_quotes.nm_id",
"populates": [
"label.quotes.id"
],
"mode": "FULL",
"referenceKey": 1
},
{
"columnName": "f_quotes.f_volume",
"populates": [
"fact.quotes.volume"
],
"mode": "FULL"
},
{
"columnName": "f_quotes.dt_quote_date",
"populates": [
"dt.quotes.quote_date"
],
"mode": "FULL"
},
{
"columnName": "f_quotes.f_open_price",
"populates": [
"fact.quotes.open_price"
],
"mode": "FULL"
},
{
"columnName": "d_quotes_symbol.nm_symbol",
"populates": [
"label.quotes.symbol"
],
"mode": "FULL",
"referenceKey": 1
},
{
"columnName": "d_quotes_symbol.nm_company",
"populates": [
"label.quotes.symbol.company"
],
"mode": "FULL"
},
{
"columnName": "f_quotes.f_high_price",
"populates": [
"fact.quotes.high_price"
],
"mode": "FULL"
},
{
"columnName": "d_quotes_industry.nm_industry",
"populates": [
"label.quotes.industry"
],
"mode": "FULL",
"referenceKey": 1
},
{
"columnName": "f_quotes.f_close_price",
"populates": [
"fact.quotes.close_price"
],
"mode": "FULL"
},
{
"columnName": "f_quotes.f_adjusted_close_price",
"populates": [
"fact.quotes.adjusted_close_price"
],
"mode": "FULL"
}
],
"file": "dataset.quotes.csv",
"dataSet": "dataset.quotes"
}
}
--
Data Upload
The Data Upload API can be used for uploading the data directly to your Project.
Using the resources below, you are able to start data uplaod process with the file package stored on GoodData **WebDav Server** (secure-di.gooddata.com/uploads/).
The package must contain **upload-info.json** and **CSV** file for every dataset that you want to upload.
##Upload properties
- pullIntegration : path to directory where your upload package is stored
- pullTask : asynchronous task that is created for each data upload process
--
Start data upload using this resource. As parameter, use the name of WebDav directory, where you uploaded Data. Upload archive should be named upload.zip and must contain **upload_info.json** (SLI manifest) and **CSV file** with data. See the Data Model resources to learn about SLI manifest.
POST /md/{project-id}/etl/pull
> Content-Type: application/json
> Accept: application/json
{"pullIntegration":"directory-with-upload-package"}
< 200
< Content-Type: application/json
{
"pullTask" : {
"uri" : "/gdc/md/{project-id}/etl/task/{task-id}"
}
}
This is resource returned by previous POST. Poll it to get the upload status.
GET /md/{project-id}/etl/task/{task-id}
> Content-Type: application/json
> Accept: application/json
< 200
< Content-Type: application/json
{
"taskStatus" : "OK | Error"
}
--
Notifications
Notifications allow users to be informed about some specific events in the Project. Notifications are based on Channel Configuration, where user specifies
what is the channel, where he wants to send the notification. Second step is a Subscription settings, that will subscribe the user to a specific channel
with specific condition for triggering the notification.
## Notifications properties
- channelConfiguration : Specifies the channel configuration configuration
- username (string) : User's channel login for specific channel
- password (string) : User's password for specific configuration
- title (string) : Title of channel configuration
- author (uri) : URI of user who creates the notification channel
- created (date) : Date of channel configuration creation
- updated (date) : Date of channel configuration update
- from : Phone number of notification sender (for Twillio Channel)
- to : Phone number of notification recipient (for Twillio Channel)
- timerEvent (cron Expression) : Specifies the interval for notification check
- condition : Condition that must be fulfil to send the notification
- message : Message that is sent via specific channel as notification
--
To create new Salesforce Notifications channel use this method
POST /account/profile/{profile-id}/channelConfigurations
> Content-Type: application/json
> Accept: application/json
{
"channelConfiguration":{
"configuration":{
"sfdcChatterConfiguration":{
"username":"your@email",
"password":"passwordSecurityToken"
}
},
"meta":{
"title":"SFDC Channel"
}
}
}
< 201
< Content-Type: application/json
{
"channelConfiguration": {
"configuration": {
"sfdcChatterConfiguration": {
"username": "[email protected]"
}
},
"meta": {
"title": "Channel Name",
"author": "/gdc/account/profile/PROFILE_ID",
"category": "channelConfiguration",
"updated": "2011-12-20 13:43:17",
"created": "2011-12-20 13:43:17",
"uri": "/gdc/account/profile/{profile-id}/channelConfigurations/{channel-id}"
}
}
}
To create new Twillio Notifications channel use this method
POST /account/profile/{profile-id}/channelConfigurations
> Content-Type: application/json
> Accept: application/json
{
"channelConfiguration":{
"configuration":{
"twilioSmsConfiguration":{
"username":"username",
"password":"AUTH TOKEN",
"from":"+14086457515",
"to":"+420724000000"
}
},
"meta":{
"title":"Twilio Title"
}
}
}
< 201
< Content-Type: application/json
{
"channelConfiguration": {
"configuration": {
"twilioSmsConfiguration": {
"username": "[email protected]"
}
},
"meta": {
"title": "Channel Name",
"author": "/gdc/account/profile/{profile-id}",
"category": "channelConfiguration",
"updated": "2011-12-20 13:43:17",
"created": "2011-12-20 13:43:17",
"uri": "/gdc/account/profile/PROFILE_ID/channelConfigurations/CHANNEL_ID"
}
}
}
To create new Subscription, call this resource and set the timerEvent, condition expression and message that will be sent
POST /projects/{project-id}/users/{user-id}/subscriptions
> Content-Type: application/json
> Accept: application/json
{
"subscription":{
"triggers":[
{
"timerEvent":{
"cronExpression":"0 0/5 * * * *"
}
}
],
"condition":{
"condition":{
"expression":"f:executeMetric('METRIC_URI') < 16"
}
},
"message":{
"template":{
"expression":"Average Chatter posts per Opportunity has fallen to ${f:executeMetric('METRIC_URI')} ..."
}
},
"channels":[
"CHANNEL_URI"
],
"meta":{
"title":"Avg Posts per Oppty < 16"
}
}
}
< 201
< Content-Type: application/json
{
"subscription": {
"triggers": [
{
"timerEvent": {
"cronExpression": "0 0/5 * * * *"
}
}
],
"condition": {
"condition": {
"expression": "f:executeMetric('/gdc/md/PROJECT_ID/obj/OBJECT_ID') < 0.99"
}
},
"message": {
"template": {
"expression": "Custom message % ${f:executeMetric('/gdc/md/PROJECT_ID/obj/OBJECT_ID')} ..."
}
},
"channels": [
"/gdc/account/profile/USER_ID/channelConfigurations/CHANNEL_ID"
],
"meta": {
"title": "TEST%",
"author": "/gdc/account/profile/USER_ID",
"category": "subscription",
"updated": "2011-12-20 13:59:23",
"created": "2011-12-20 13:59:23",
"uri": "/gdc/projects/PROJECT_ID_/users/USER_ID_/subscriptions/SUBSCRIPTION_ID"
}
}
}
--
Report
Reports can be also handled via API. You can use following resources for getting list of all report, execute selected reports and export it.
##Report Properties
- link (uri) : Link to specific Report
- author (uri) : URI of Report author
- tags : Report tags
- created (date) : Report creation date
- updated (date) : Report update date
- summary (string) : Report text summary
- report (uri) : Specific report URI
- format : Report export format (pdf, csv, png)
--
Use this method to list all Reports in given Project
GET /md/{project-id}/query/reports
> Content-Type: application/json
> Accept: application/json
< 200
< Content-Type: application/json
{
"query": {
"entries": [
{
"link": "/gdc/md/PROJECT_ID/obj/OBJECT_ID",
"author": "/gdc/account/profile/USER_ID",
"tags": "",
"created": "2011-11-23 15:34:18",
"deprecated": "0",
"summary": "",
"title": "Report Title",
"category": "report",
"updated": "2011-11-23 15:41:44",
"contributor": "/gdc/account/profile/USER_ID"
}],
"meta": {
"summary": "Metadata Query Resources for project 'PROJECT_ID'",
"title": "List of reports",
"category": "query"
}
}
}
Use this method to execute selected Report
POST /xtab2/executor3
> Content-Type: application/json
> Accept: application/json
{
"report_req": {
"reportDefinition": "/gdc/md/PROJECT_ID/obj/OBJECT_ID"
}
}
< 201
< Content-Type: application/json
{
"reportResult2": {
...
...
...
"meta": {
"author": "/gdc/account/profile/USER_ID",
"uri": "/gdc/md/PROJECT_ID/obj/RESULT_OBJECT_ID",
"tags": "",
"created": "2011-12-20 15:23:20",
"identifier": "IDENTIFIER",
"deprecated": "0",
"summary": "",
"title": "TITLE",
"category": "reportResult2",
"updated": "2011-12-20 15:23:20",
"contributor": "/gdc/account/profile/USER_ID"
}
}
}
This method can be used for exporting Report
POST /exporter/executor
> Content-Type: application/json
> Accept: application/json
{
"result_req": {
"report":"/gdc/md/PROJECT_ID/obj/OBJECT_ID",
"format":"csv"
}
}
< 201
< Content-Type: application/json
{
"uri":"/gdc/exporter/result/PROJECT_ID/RESULT_ID"
}
--
Dashboard
Following resources cover Project Dashboard operation. You can list all Dashboards in Project, GET Dashboard content and update it.
--
Use this method to list of all Dashboards in given Project
GET /md/{project-id}/query/projectDashboards
> Content-Type: application/json
> Accept: application/json
< 200
< Content-Type: application/json
{
"query": {
"entries": [
{
"link": "/gdc/md/{project-id}/obj/{object-id}",
"author": "/gdc/account/profile/{user-id}",
"tags": "",
"created": "2012-08-15 19:41:07",
"deprecated": "0",
"summary": "",
"category": "projectDashboard",
"title": "Overview",
"updated": "2012-09-04 15:56:36",
"contributor": "/gdc/account/profile/{user-id}"
}
],
"meta": {
"summary": "Metadata Query Resources for project '{project-id}'",
"title": "List of projectdashboards",
"category": "query"
}
}
}
Use this method to GET dashboard object content
GET /md/{project-id}/obj/{object-id}
> Content-Type: application/json
> Accept: application/json
< 200
< Content-Type: application/json
{
"projectDashboard": {
"content": {
"filters": [],
"tabs": [
{
"title": "Dashboard Name",
"identifier": "afblCPlxel0Y",
"items": [
{
"reportItem": {
"positionX": 410,
"positionY": 0,
"sizeX": 530,
"sizeY": 310,
"style": {
"background": {
"opacity": 0
}
},
"obj": "/gdc/md/{project-id}/obj/{object-id}",
"visualization": {
"oneNumber": {
"labels": {}
},
"grid": {
"columnWidths": []
}
},
"filters": []
}
},
{
"headlineItem": {
"positionX": 0,
"positionY": 0,
"sizeX": 380,
"sizeY": 80,
"title": "Tržby",
"metric": "/gdc/md/{project-id}/obj/{object-id}",
"format": "#,##0.00 KÄ \n",
"filters": [],
"filterAttributeDF": "/gdc/md/{project-id}/obj/{object-id}",
"linkedWithExternalFilter": 0,
"constraint": {
"to": 0,
"from": 0,
"type": "floating"
},
"trendlineConfig": {