Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(sdk): note that contacts check needs an OPERATOR key

Yudhi Armyndharis9ede00339d26
diff --git a/sdk/go/contacts.go b/sdk/go/contacts.go
index 320a66ba8..1b9c7ea4d 100644
--- a/sdk/go/contacts.go
+++ b/sdk/go/contacts.go
@@ -31,7 +31,8 @@ func (s *ContactsService) Get(ctx context.Context, sessionID, contactID string)
return &out, nil
}
-// Check reports whether a number is on WhatsApp.
+// Check reports whether a number is on WhatsApp. Requires an OPERATOR-level
+// key.
func (s *ContactsService) Check(ctx context.Context, sessionID, number string) (*CheckNumberResponse, error) {
var out CheckNumberResponse
err := s.client.do(ctx, "GET", s.base(sessionID)+"/check/"+pathEscape(number), nil, nil, &out)
diff --git a/sdk/java/src/main/java/com/rmyndharis/openwa/resources/ContactsResource.java b/sdk/java/src/main/java/com/rmyndharis/openwa/resources/ContactsResource.java
index 82485ccaf..64905fa62 100644
--- a/sdk/java/src/main/java/com/rmyndharis/openwa/resources/ContactsResource.java
+++ b/sdk/java/src/main/java/com/rmyndharis/openwa/resources/ContactsResource.java
@@ -43,7 +43,7 @@ public final class ContactsResource {
ContactRecord.class);
}
- /** Check whether a phone number is registered on WhatsApp. */
+ /** Check whether a phone number is registered on WhatsApp. Requires an OPERATOR-level key. */
public CheckNumberResponse check(String sessionId, String number) {
return client.request(
HttpMethod.GET,
diff --git a/sdk/javascript/src/resources/contacts.ts b/sdk/javascript/src/resources/contacts.ts
index ddf114130..0ff557c8d 100644
--- a/sdk/javascript/src/resources/contacts.ts
+++ b/sdk/javascript/src/resources/contacts.ts
@@ -42,7 +42,7 @@ export class ContactsResource {
});
}
- /** Check whether a phone number is registered on WhatsApp. */
+ /** Check whether a phone number is registered on WhatsApp. Requires an OPERATOR-level key. */
check(sessionId: string, number: string): Promise<CheckNumberResponse> {
return this.client.request<CheckNumberResponse>({
method: 'GET',
diff --git a/sdk/php/src/Resources/ContactsResource.php b/sdk/php/src/Resources/ContactsResource.php
index f1ec168e3..c07453ce7 100644
--- a/sdk/php/src/Resources/ContactsResource.php
+++ b/sdk/php/src/Resources/ContactsResource.php
@@ -35,7 +35,11 @@ class ContactsResource
return $this->http->request('GET', "/api/sessions/{$this->http->encodeSegment($sessionId)}/contacts/{$this->http->encodeSegment($contactId)}");
}
- /** @return array<string,mixed> */
+ /**
+ * Check whether a number is on WhatsApp. Requires an OPERATOR key.
+ *
+ * @return array<string,mixed>
+ */
public function check(string $sessionId, string $number): array
{
return $this->http->request('GET', "/api/sessions/{$this->http->encodeSegment($sessionId)}/contacts/check/{$this->http->encodeSegment($number)}");
diff --git a/sdk/python/openwa/resources/contacts.py b/sdk/python/openwa/resources/contacts.py
index 798e3be8a..5cd4a8331 100644
--- a/sdk/python/openwa/resources/contacts.py
+++ b/sdk/python/openwa/resources/contacts.py
@@ -38,6 +38,7 @@ class ContactsResource:
return self._http.request("GET", f"/api/sessions/{quote_segment(session_id)}/contacts/{quote_segment(contact_id)}")
def check(self, session_id: str, number: str) -> CheckNumberResponse:
+ """Check whether a number is on WhatsApp (OPERATOR)."""
return self._http.request("GET", f"/api/sessions/{quote_segment(session_id)}/contacts/check/{quote_segment(number)}")
def profile_picture(self, session_id: str, contact_id: str) -> ProfilePictureResponse: