Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ MESSAGES_EMOJI='MESSAGES_EMOJI'
WHATSAPP_STICKER_ID='WHATSAPP_STICKER_ID'
WHATSAPP_STICKER_URL='WHATSAPP_STICKER_URL'

# Identity Insights
IDENTITY_INSIGHTS_NUMBER='IDENTITY_INSIGHTS_NUMBER'
IDENTITY_INSIGHTS_PURPOSE='IDENTITY_INSIGHTS_PURPOSE'
IDENTITY_INSIGHTS_API_HOST='api-eu.vonage.com'

# NI
INSIGHT_NUMBER='INSIGHT_NUMBER'
INSIGHT_CALLBACK_URL='INSIGHT_CALLBACK_URL'
Expand Down
45 changes: 45 additions & 0 deletions identity-insights/get-all-insights.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import os
from os.path import dirname, join
from pprint import pprint

from dotenv import load_dotenv

dotenv_path = join(dirname(__file__), "../.env")
load_dotenv(dotenv_path)

VONAGE_APPLICATION_ID = os.environ.get("VONAGE_APPLICATION_ID")
VONAGE_PRIVATE_KEY = os.environ.get("VONAGE_PRIVATE_KEY")
IDENTITY_INSIGHTS_NUMBER = os.environ.get("IDENTITY_INSIGHTS_NUMBER")
IDENTITY_INSIGHTS_PURPOSE = os.environ.get("IDENTITY_INSIGHTS_PURPOSE")
IDENTITY_INSIGHTS_API_HOST = os.environ.get("IDENTITY_INSIGHTS_API_HOST")

from vonage import Auth, HttpClientOptions, Vonage
from vonage_identity_insights import (
EmptyInsight,
IdentityInsightsRequest,
IdentityInsightsResponse,
InsightsRequest,
SimSwapInsight,
)

client = Vonage(
auth=Auth(
application_id=VONAGE_APPLICATION_ID,
private_key=VONAGE_PRIVATE_KEY,
),
http_client_options=HttpClientOptions(api_host=IDENTITY_INSIGHTS_API_HOST),
)

request = IdentityInsightsRequest(
phone_number=IDENTITY_INSIGHTS_NUMBER,
purpose=IDENTITY_INSIGHTS_PURPOSE,
insights=InsightsRequest(
format=EmptyInsight(),
sim_swap=SimSwapInsight(period=240),
original_carrier=EmptyInsight(),
current_carrier=EmptyInsight(),
),
)

response: IdentityInsightsResponse = client.identity_insights.requests(request)
pprint(response)
37 changes: 37 additions & 0 deletions identity-insights/get-current-carrier.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import os
from os.path import dirname, join
from pprint import pprint

from dotenv import load_dotenv

dotenv_path = join(dirname(__file__), "../.env")
load_dotenv(dotenv_path)

VONAGE_APPLICATION_ID = os.environ.get("VONAGE_APPLICATION_ID")
VONAGE_PRIVATE_KEY = os.environ.get("VONAGE_PRIVATE_KEY")
IDENTITY_INSIGHTS_NUMBER = os.environ.get("IDENTITY_INSIGHTS_NUMBER")
IDENTITY_INSIGHTS_API_HOST = os.environ.get("IDENTITY_INSIGHTS_API_HOST")

from vonage import Auth, HttpClientOptions, Vonage
from vonage_identity_insights import (
EmptyInsight,
IdentityInsightsRequest,
IdentityInsightsResponse,
InsightsRequest,
)

client = Vonage(
auth=Auth(
application_id=VONAGE_APPLICATION_ID,
private_key=VONAGE_PRIVATE_KEY,
),
http_client_options=HttpClientOptions(api_host=IDENTITY_INSIGHTS_API_HOST),
)

request = IdentityInsightsRequest(
phone_number=IDENTITY_INSIGHTS_NUMBER,
insights=InsightsRequest(current_carrier=EmptyInsight()),
)

response: IdentityInsightsResponse = client.identity_insights.requests(request)
pprint(response)
37 changes: 37 additions & 0 deletions identity-insights/get-format-insight.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import os
from os.path import dirname, join
from pprint import pprint

from dotenv import load_dotenv

dotenv_path = join(dirname(__file__), "../.env")
load_dotenv(dotenv_path)

VONAGE_APPLICATION_ID = os.environ.get("VONAGE_APPLICATION_ID")
VONAGE_PRIVATE_KEY = os.environ.get("VONAGE_PRIVATE_KEY")
IDENTITY_INSIGHTS_NUMBER = os.environ.get("IDENTITY_INSIGHTS_NUMBER")
IDENTITY_INSIGHTS_API_HOST = os.environ.get("IDENTITY_INSIGHTS_API_HOST")

from vonage import Auth, HttpClientOptions, Vonage
from vonage_identity_insights import (
EmptyInsight,
IdentityInsightsRequest,
IdentityInsightsResponse,
InsightsRequest,
)

client = Vonage(
auth=Auth(
application_id=VONAGE_APPLICATION_ID,
private_key=VONAGE_PRIVATE_KEY,
),
http_client_options=HttpClientOptions(api_host=IDENTITY_INSIGHTS_API_HOST),
)

request = IdentityInsightsRequest(
phone_number=IDENTITY_INSIGHTS_NUMBER,
insights=InsightsRequest(format=EmptyInsight()),
)

response: IdentityInsightsResponse = client.identity_insights.requests(request)
pprint(response)
37 changes: 37 additions & 0 deletions identity-insights/get-original-carrier.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import os
from os.path import dirname, join
from pprint import pprint

from dotenv import load_dotenv

dotenv_path = join(dirname(__file__), "../.env")
load_dotenv(dotenv_path)

VONAGE_APPLICATION_ID = os.environ.get("VONAGE_APPLICATION_ID")
VONAGE_PRIVATE_KEY = os.environ.get("VONAGE_PRIVATE_KEY")
IDENTITY_INSIGHTS_NUMBER = os.environ.get("IDENTITY_INSIGHTS_NUMBER")
IDENTITY_INSIGHTS_API_HOST = os.environ.get("IDENTITY_INSIGHTS_API_HOST")

from vonage import Auth, HttpClientOptions, Vonage
from vonage_identity_insights import (
EmptyInsight,
IdentityInsightsRequest,
IdentityInsightsResponse,
InsightsRequest,
)

client = Vonage(
auth=Auth(
application_id=VONAGE_APPLICATION_ID,
private_key=VONAGE_PRIVATE_KEY,
),
http_client_options=HttpClientOptions(api_host=IDENTITY_INSIGHTS_API_HOST),
)

request = IdentityInsightsRequest(
phone_number=IDENTITY_INSIGHTS_NUMBER,
insights=InsightsRequest(original_carrier=EmptyInsight()),
)

response: IdentityInsightsResponse = client.identity_insights.requests(request)
pprint(response)
39 changes: 39 additions & 0 deletions identity-insights/get-sim-swap.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import os
from os.path import dirname, join
from pprint import pprint

from dotenv import load_dotenv

dotenv_path = join(dirname(__file__), "../.env")
load_dotenv(dotenv_path)

VONAGE_APPLICATION_ID = os.environ.get("VONAGE_APPLICATION_ID")
VONAGE_PRIVATE_KEY = os.environ.get("VONAGE_PRIVATE_KEY")
IDENTITY_INSIGHTS_NUMBER = os.environ.get("IDENTITY_INSIGHTS_NUMBER")
IDENTITY_INSIGHTS_PURPOSE = os.environ.get("IDENTITY_INSIGHTS_PURPOSE")
IDENTITY_INSIGHTS_API_HOST = os.environ.get("IDENTITY_INSIGHTS_API_HOST")

from vonage import Auth, HttpClientOptions, Vonage
from vonage_identity_insights import (
IdentityInsightsRequest,
IdentityInsightsResponse,
InsightsRequest,
SimSwapInsight,
)

client = Vonage(
auth=Auth(
application_id=VONAGE_APPLICATION_ID,
private_key=VONAGE_PRIVATE_KEY,
),
http_client_options=HttpClientOptions(api_host=IDENTITY_INSIGHTS_API_HOST),
)

request = IdentityInsightsRequest(
phone_number=IDENTITY_INSIGHTS_NUMBER,
purpose=IDENTITY_INSIGHTS_PURPOSE,
insights=InsightsRequest(sim_swap=SimSwapInsight(period=240)),
)

response: IdentityInsightsResponse = client.identity_insights.requests(request)
pprint(response)
Loading