Skip to content

Commit

Permalink
Remove phoneNumber from docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ripreal committed Oct 14, 2022
1 parent 819e49b commit 205f9f9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ WhatsApp mobile app authentication may be achived by using [control panel](https

## Examples

Please do not use 'phoneNumber' parameter when calling methods. It is deprecated. Examples below are based on 'chatId' paramemeter

### Send WhatsApp message

Use common javascript
Expand All @@ -68,7 +70,7 @@ const restAPI = whatsAppClient.restAPI({
apiTokenInstance: "YOUR_API_TOKEN_INSTANCE",
});

restAPI.message.sendMessage(null, 79999999999, "hello world").then((data) => {
restAPI.message.sendMessage("[email protected]", null , "hello world").then((data) => {
console.log(data);
});
```
Expand All @@ -83,7 +85,7 @@ or use browser js script
apiTokenInstance: "YOUR_API_TOKEN_INSTANCE",
});
restAPI.message
.sendMessage(null, 79999999999, "hello world")
.sendMessage("[email protected]", null, "hello world")
.then((data) => {
console.log(data);
})
Expand All @@ -104,8 +106,8 @@ import whatsAppClient from "@green-api/whatsapp-api-client";
apiTokenInstance: "YOUR_API_TOKEN_INSTANCE",
});
const response = await restAPI.message.sendMessage(
"[email protected]",
null,
79999999999,
"hello world"
);
})();
Expand Down Expand Up @@ -171,8 +173,8 @@ import whatsAppClient from "@green-api/whatsapp-api-client";
apiTokenInstance: "YOUR_API_TOKEN_INSTANCE",
});
const response = await restAPI.file.sendFileByUrl(
"[email protected]",
null,
79999999999,
"https://avatars.mds.yandex.net/get-pdb/477388/77f64197-87d2-42cf-9305-14f49c65f1da/s375",
"horse.png",
"horse"
Expand Down Expand Up @@ -218,8 +220,8 @@ import bodyParser from "body-parser";
});
// Send test message that triggers webhook
const response = await restAPI.message.sendMessage(
"[email protected]",
null,
79999999999,
"hello world"
);
});
Expand Down
12 changes: 7 additions & 5 deletions README_RUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ import * as whatsAppClient from "@green-api/whatsapp-api-client";

## Примеры

Не испольуйте параметр 'phoneNumber' при вызове методов. Он устарел. Примеры ниже используют параметр 'chatId'

### Отправка сообщения на номер WhatsApp
Используя common js
``` js
Expand All @@ -57,7 +59,7 @@ const restAPI = whatsAppClient.restAPI(({
apiTokenInstance: YOUR_API_TOKEN_INSTANCE
}))

restAPI.message.sendMessage(null, 79999999999, "hello world")
restAPI.message.sendMessage("[email protected]", null, "hello world")
.then((data) => {
console.log(data);
}) ;
Expand All @@ -71,7 +73,7 @@ restAPI.message.sendMessage(null, 79999999999, "hello world")
idInstance: "YOUR_ID_INSTANCE",
apiTokenInstance: "YOUR_API_TOKEN_INSTANCE"
}))
restAPI.message.sendMessage(null, 79999999999, "hello world")
restAPI.message.sendMessage("[email protected]", null, "hello world")
.then((data) => {
console.log(data);
}).catch((reason) =>{
Expand All @@ -89,7 +91,7 @@ import whatsAppClient from '@green-api/whatsapp-api-client'
idInstance: YOUR_ID_INSTANCE,
apiTokenInstance: YOUR_API_TOKEN_INSTANCE
}))
const response = await restAPI.message.sendMessage(null, 79999999999, "hello world");
const response = await restAPI.message.sendMessage("[email protected]", null, "hello world");
})();
```

Expand Down Expand Up @@ -150,7 +152,7 @@ import whatsAppClient from '@green-api/whatsapp-api-client'
idInstance: YOUR_ID_INSTANCE,
apiTokenInstance: YOUR_API_TOKEN_INSTANCE
}))
const response = await restAPI.file.sendFileByUrl(null, 79999999999, 'https://avatars.mds.yandex.net/get-pdb/477388/77f64197-87d2-42cf-9305-14f49c65f1da/s375', 'horse.png', 'horse');
const response = await restAPI.file.sendFileByUrl("[email protected]", null, 'https://avatars.mds.yandex.net/get-pdb/477388/77f64197-87d2-42cf-9305-14f49c65f1da/s375', 'horse.png', 'horse');
})();
```

Expand Down Expand Up @@ -190,7 +192,7 @@ import bodyParser from 'body-parser';
apiTokenInstance: MY_API_TOKEN_INSTANCE
}));
// Отправляем тестовое сообщение, для того чтобы сработали события вебхуков
const response = await restAPI.message.sendMessage(null, 79999999999, "hello world");
const response = await restAPI.message.sendMessage("[email protected]", null, "hello world");

});
} catch (error) {
Expand Down

0 comments on commit 205f9f9

Please sign in to comment.