You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-9
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# looker_api_31_reference
1
+
# looker-node-api
2
2
3
-
LookerApi31Reference - JavaScript client for looker_api_31_reference
3
+
LookerApi31Reference - JavaScript client for looker-node-api
4
4
### Authorization
5
5
The Looker API uses Looker **API3** credentials for authorization and access control. Looker admins can create API3 credentials on Looker's **Admin/Users** page. Pass API3 credentials to the **_/login** endpoint to obtain a temporary access_token. Include that access_token in the Authorization header of Looker API requests. For details, see [Looker API Authorization](https://looker.com/docs/r/api/authorization)
6
6
### Client SDKs
@@ -48,7 +48,7 @@ please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.co
48
48
Then install it via:
49
49
50
50
```shell
51
-
npm install looker_api_31_reference --save
51
+
npm install looker-node-api --save
52
52
```
53
53
54
54
##### Local development
@@ -66,23 +66,23 @@ Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the follow
66
66
npm link
67
67
```
68
68
69
-
Finally, switch to the directory you want to use your looker_api_31_reference from, and run:
69
+
Finally, switch to the directory you want to use your looker-node-api from, and run:
70
70
71
71
```shell
72
72
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
73
73
```
74
74
75
-
You should now be able to `require('looker_api_31_reference')` in javascript files from the directory you ran the last
75
+
You should now be able to `require('looker-node-api')` in javascript files from the directory you ran the last
76
76
command above from.
77
77
78
78
#### git
79
79
#
80
80
If the library is hosted at a git repository, e.g.
### Present client credentials to obtain an authorization token Looker API implements the OAuth2 [Resource Owner Password Credentials Grant](https://looker.com/docs/r/api/outh2_resource_owner_pc) pattern. The client credentials required for this login must be obtained by creating an API3 key on a user account in the Looker Admin console. The API3 key consists of a public `client_id` and a private `client_secret`. The access token returned by `login` must be used in the HTTP Authorization header of subsequent API requests, like this: ``` Authorization: token 4QDkCyCtZzYgj4C2p2cj3csJH7zqS5RzKs2kTnG4 ``` Replace \"4QDkCy...\" with the `access_token` value returned by `login`. The word `token` is a string literal and must be included exactly as shown. This function can accept `client_id` and `client_secret` parameters as URL query params or as www-form-urlencoded params in the body of the HTTP request. Since there is a small risk that URL parameters may be visible to intermediate nodes on the network route (proxies, routers, etc), passing credentials in the body of the request is considered more secure than URL params. Example of passing credentials in the HTTP request body: ```` POST HTTP /login Content-Type: application/x-www-form-urlencoded client_id=CGc9B7v7J48dQSJvxxx&client_secret=nNVS9cSS3xNpSC9JdsBvvvvv ```` ### Best Practice: Always pass credentials in body params. Pass credentials in URL query params **only** when you cannot pass body params due to application, tool, or other limitations. For more information and detailed examples of Looker API authorization, see [How to Authenticate to Looker API3](https://github.com/looker/looker-sdk-ruby/blob/master/authentication.md).
18
+
### Present client credentials to obtain an authorization token Looker API implements the OAuth2 [Resource Owner Password Credentials Grant](https://looker.com/docs/r/api/outh2_resource_owner_pc) pattern. The client credentials required for this login must be obtained by creating an API3 key on a user account in the Looker Admin console. The API3 key consists of a public `client_id` and a private `client_secret`. The access token returned by `login` must be used in the HTTP Authorization header of subsequent API requests, like this: ``` Authorization: token 4QDkCyCtZzYgj4C2p2cj3csJH7zqS5RzKs2kTnG4 ``` Replace \"4QDkCy...\" with the `access_token` value returned by `login`. The word `token` is a string literal and must be included exactly as shown. This function can accept `client_id` and `client_secret` parameters as URL query params or as www-form-urlencoded params in the body of the HTTP request. Since there is a small risk that URL parameters may be visible to intermediate nodes on the network route (proxies, routers, etc), passing credentials in the body of the request is considered more secure than URL params. Example of passing credentials in the HTTP request body: ```` POST HTTP /login Content-Type: application/x-www-form-urlencoded client_id=CGc9B7v7J48dQSJvxxx&client_secret=nNVS9cSS3xNpSC9JdsBvvvvv ```` ### Best Practice: Always pass credentials in body params. Pass credentials in URL query params **only** when you cannot pass body params due to application, tool, or other limitations. For more information and detailed examples of Looker API authorization, see [How to Authenticate to Looker API3](https://github.com/looker/looker-sdk-ruby/blob/master/authentication.md).
19
19
20
20
### Example
21
21
```javascript
22
-
var LookerApi31Reference =require('looker_api_31_reference');
22
+
var LookerApi31Reference =require('looker-node-api');
23
23
24
24
var apiInstance =newLookerApi31Reference.ApiAuthApi();
25
25
26
-
var opts = {
26
+
var opts = {
27
27
'clientId':"clientId_example", // String | client_id part of API3 Key.
28
28
'clientSecret':"clientSecret_example"// String | client_secret part of API3 Key.
**clientId** | **String**| client_id part of API3 Key. | [optional]
46
-
**clientSecret** | **String**| client_secret part of API3 Key. | [optional]
45
+
**clientId** | **String**| client_id part of API3 Key. | [optional]
46
+
**clientSecret** | **String**| client_secret part of API3 Key. | [optional]
47
47
48
48
### Return type
49
49
@@ -64,11 +64,11 @@ No authorization required
64
64
65
65
Login user
66
66
67
-
### Create an access token for a given user. This can only be called by an authenticated admin user. It allows that admin to generate a new authentication token for the user with the given user id. That token can then be used for subsequent API calls - which are then performed *as* that target user. The target user does *not* need to have a pre-existing API client_id/client_secret pair. And, no such credentials are created by this call. This allows for building systems where api user authentication for an arbitrary number of users is done outside of Looker and funneled through a single 'service account' with admin permissions. Note that a new access token is generated on each call. If target users are going to be making numerous API calls in a short period then it is wise to cache this authentication token rather than call this before each of those API calls. See 'login' for more detail on the access token and how to use it.
67
+
### Create an access token for a given user. This can only be called by an authenticated admin user. It allows that admin to generate a new authentication token for the user with the given user id. That token can then be used for subsequent API calls - which are then performed *as* that target user. The target user does *not* need to have a pre-existing API client_id/client_secret pair. And, no such credentials are created by this call. This allows for building systems where api user authentication for an arbitrary number of users is done outside of Looker and funneled through a single 'service account' with admin permissions. Note that a new access token is generated on each call. If target users are going to be making numerous API calls in a short period then it is wise to cache this authentication token rather than call this before each of those API calls. See 'login' for more detail on the access token and how to use it.
68
68
69
69
### Example
70
70
```javascript
71
-
var LookerApi31Reference =require('looker_api_31_reference');
71
+
var LookerApi31Reference =require('looker-node-api');
72
72
73
73
var apiInstance =newLookerApi31Reference.ApiAuthApi();
0 commit comments