-
Notifications
You must be signed in to change notification settings - Fork 18
/
get-StoryousAPIKey.pq
54 lines (54 loc) · 1.8 KB
/
get-StoryousAPIKey.pq
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
let
output =
(client as text, secret as text) as text =>
let
urlW = "https://login.storyous.com/api/auth/authorize",
header = [
#"Content-Type" = "application/x-www-form-urlencoded"
],
secretW = secret,
clientW = client,
content =
"client_id="
& clientW
& "&client_secret="
& secretW
& "&grant_type=client_credentials",
call =
Json.Document(
Web.Contents(
urlW,
[
Headers = header,
Content = Text.ToBinary(content)
]
)
),
Bearer =
Record.Field(call, "token_type")
& " "
& Record.Field(call, "access_token")
in
Bearer,
documentation = [
Documentation.Name = " get-StoryousDataOfMarketPlaceBillsByAPI.pq ",
Documentation.Description = " Getting Storious API Key for next functions as get-StoryousDataOfMarketPlaceBillsByAPI.pq ",
Documentation.Source = "https://www.jaknapowerbi.cz",
Documentation.Version = " 1.0 ",
Documentation.Author = " Štěpán Rešl ",
Documentation.Examples = {
[
Description = " Input: clientID, clientSecret ",
Code = "",
Result = ""
]
}
]
in
Value.ReplaceType(
output,
Value.ReplaceMetadata(
Value.Type(output),
documentation
)
)