Skip to content
This repository was archived by the owner on Mar 5, 2024. It is now read-only.

Commit 65c2208

Browse files
authored
Update README.md
1 parent c933f43 commit 65c2208

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

README.md

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ composer install
2525
composer require google/cloud-dialogflow
2626
```
2727

28-
## Download the Google Account Credentials File
28+
## Usage
2929
- Download the Google Account Credentials JSON file for your v2 Dialogflow agent into the diaglogflow-php folder
3030

3131
- Make sure v2 API is enabled in Dialogflow
@@ -40,23 +40,7 @@ composer require google/cloud-dialogflow
4040
- Click on the create
4141
![create_key_slideout](https://user-images.githubusercontent.com/50250422/135780443-9d351d03-405c-49a4-9317-9131bab92041.png)
4242
- You will be prompted to save the Google Account Credentials JSON file. Save the file as `service-account-file.json` to the dialogflow-php folder.
43-
44-
## usage
45-
- Create a `config.json` file with below file contents.
46-
```json
47-
{
48-
"GOOGLE_APPLICATION_CREDENTIALS": "service-account-file.json",
49-
"SESSION_ID": "Session-ID",
50-
"PROJECT_ID": "project-id"
51-
}
52-
```
53-
- Or Rename `config.example.json` file with `config.json`. Open `config.json` with any text editor and change everything.
54-
55-
1. <b>GOOGLE_APPLICATION_CREDENTIALS</b> : Replace `service-account-file.json` in above json with the [google account credentials](https://cloud.google.com/docs/authentication/production) file name downloaded from gcloud.
56-
> Note :- You should place your [Google Account Credentials](https://cloud.google.com/docs/authentication/production) file, `config json` and `dialogflow.php` in the root dictionary on your server. It's on you to ensure that [google account credentials](https://cloud.google.com/docs/authentication/production) file and `config.json` file are not accessible from the web!
57-
2. <b>SESSION_ID</b> : `Session-ID`, can be any string for this purpose. However, if you are going to be using the client library to manage an entire conversation, your Session-ID must be the same across an entire
58-
3. <b>PROJECT_ID</b> : Replace `project-id` with your project ID.
59-
43+
> Make sure that `service-account-file.json` file is in main directory
6044
- Now create a web server and send a post request.
6145
```sh
6246
curl -Xs POST http://localhost:8080/dialogflow.php \
@@ -97,7 +81,8 @@ curl -Xs POST http://localhost:8080/dialogflow.php \
9781
```
9882

9983
## Testing
100-
- After creating `config.json` file create a php server.
84+
- After saving the `service-account-file.json` file in main directory.
85+
- start a PHP server (for testing purpose)
10186
```php
10287
php -S localhost:8080
10388
```

0 commit comments

Comments
 (0)