Comments (5)
Glad to know that you got it working. What I meant by calling external APIs is, that the SDK doesn't provide any helper functions or any configurations through which skill developers can do a simple function call to external APIs.
For Alexa specific APIs, as you can check in your ISP code, you can just do a handler_input.service_client_factory.get_monetization_service().<call_some_method>
. However, you cannot use the service client factory to call any external API. Hope this helps.
Since you are able to get this working, I am going ahead and closing this issue. Please let us know if you face any other problems. Thanks.
from alexa-skills-kit-sdk-for-python.
Hey @danieldhz , StandardSkillBuilder
and CustomSkillBuilder
are different types of skill builder, which eventually will give you a skill for dispatching the input requests. You will need only one type of skill builder for a specific skill.
For your context, you can directly use StandardSkillBuilder
without any api client initalization. The SDK will handle that for you. Hope this helps.
from alexa-skills-kit-sdk-for-python.
Hi @nikhilym !
Thanks for your response. So I do not need sb = CustomSkillBuilder(api_client=DefaultApiClient())
to call an external api in my function?
cause without it I am now getting:
START RequestId: aec1f79f-bb1b-4883-b7c2-829016f049ba Version: $LATEST
[INFO] 2020-09-01T19:40:01.46Z aec1f79f-bb1b-4883-b7c2-829016f049ba Starting Entitled Product Check
[INFO] 2020-09-01T19:40:01.84Z aec1f79f-bb1b-4883-b7c2-829016f049ba new session, so see what is entitled
[INFO] 2020-09-01T19:40:01.311Z aec1f79f-bb1b-4883-b7c2-829016f049ba Error calling InSkillProducts API: The authentication token is invalid or doesn't have access to make this request
[ERROR] 2020-09-01T19:40:01.324Z aec1f79f-bb1b-4883-b7c2-829016f049ba The authentication token is invalid or doesn't have access to make this request
Traceback (most recent call last):
File "/opt/python/lib/python3.8/site-packages/ask_sdk_runtime/dispatch.py", line 116, in dispatch
request_interceptor.process(handler_input=handler_input)
File "/var/task/lambda_function.py", line 188, in process
result = ms.get_in_skill_products(locale)
File "/opt/python/lib/python3.8/site-packages/ask_sdk_model/services/monetization/monetization_service_client.py", line 129, in get_in_skill_products
api_response = self.invoke(
File "/opt/python/lib/python3.8/site-packages/ask_sdk_model/services/base_service_client.py", line 151, in invoke
raise ServiceException(message=exception_metadata.message,
ask_sdk_model.services.service_exception.ServiceException: The authentication token is invalid or doesn't have access to make this requestEND RequestId:
not sure if its related
from alexa-skills-kit-sdk-for-python.
For calling alexa services, you would need the api_client
to be initialized. If you are using CustomSkillBuilder
, you can initialize it manually. If you are using StandardSkillBuilder
, it is initialized by default. We currently do not support calling external APIs (other than Alexa custom skill service APIs) from the SDK.
Now, from the error message that you pasted, it looks like the service call happened but it failed at the auth level. Since the call itself happened, your api client is initialized just fine and has nothing to do with this issue.
from alexa-skills-kit-sdk-for-python.
Thank you so much for your comprehensive explanation. I fixed the error. I am just not sure what you meant on not supporting external APIs? Alexa can't call external APIs? Cause I was just able to build a func today where Alexa made POST request on user's google calender and it was successful in the development stage.
from alexa-skills-kit-sdk-for-python.
Related Issues (20)
- ask_sdk_model.services.service_exception.ServiceException: The authentication token is invalid or doesn't have access to make this HOT 11
- `ModuleNotFoundError:` No module named 'asn1crypto'`` when importing skill adapter from flask HOT 3
- 'NoneType' object has no attribute 'system' HOT 2
- Link how to create a new security profile should be updated HOT 1
- Golang SDK - Alexa Skills kit HOT 2
- User with almost all scopes types receives unauthorized_client error HOT 2
- UserAgentManager missing from 1.15 PyPI distro HOT 3
- Alexa HOT 1
- Fail to import local modules HOT 6
- I have a intent for the alexa skill which has two slots, one of them is fulfilled while invoking the skill. I want the second slot to store the value uttered by the user at a later point of time. Is there a way to do so using python HOT 1
- Cannot import the SpokenInfo class (ask_sdk_model.services.reminder_management) HOT 2
- Receiving unauthorized_client error trying to list all skills HOT 3
- SpeakDirective doesn't create correct audio src directive HOT 1
- Outdated version of cryptography? HOT 5
- Invalid signatures with django-ask-sdk since ask-sdk-webservice-support v1.3.3 HOT 4
- ENDPOINT_TIMEOUT is not handled properly in Incorrect handling of SessionEndedRequest.
- AskForPermissionsConsentCard not showing the option to activate requested permission HOT 2
- documentation error - local_debug.py
- Bug report : Sending a voice forward consent start connection directive returns error "ask_sdk_core/response_helper.py directive.object_type has no attribute 'object_type'"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alexa-skills-kit-sdk-for-python.