How to access Content Provider in Bixby Programming - bixby

I am an amateur programmer and I would need to get the Login Details / Authorization token from another app to be able to make API calls since the data to be returned from what they ask is based on their specific account.
I have scoured their documentation but I am unable to find anything that even remotely points to accessing other app's data.
Any help is greatly appreciated. Thank You!
Regards

Update:(5/24/2021)
This was a while ago. I'm not working on Bixby now. Bixby is very dynamic and fast evolving Voice Platform.
There may be a better way to do this in latest Bixby Platform.
Please refer to the documentation and reach out to the technical support team.
Original Answer
does the target API support oAuth? If so, it is most appropriate way to access the user specific data by following standard oAuth workflow.
With oAuth, user is directed to Content Provider website for authentication and your capsule will receive auth token to access user data.
Bixby oAuth flow follows regular oAuth flow on mobile with keyboard input. So it is a standard UX without much friction.

Related

How can I get a user's Google account photo using IAP and the People API? (NodeJS preferred)

I have an application that uses Google Cloud IAP to authenticate users. IAP requires the user to authenticate using their Google account, and then headers are passed to the application afterwards that identify that user (user id, user email, and a token).
I would like to get the user's Google account photo after authentication using the People API (would use the Plus api, but it is being shut down).
NodeJS code examples would help a ton, but either a high level guide or examples in other languages would also be very helpful. Thanks in advance!
For anyone that may come across this, here is the solution I found.
You will need to enable the People API in your GCP console. Then create an API key for it.
Get the 'x-goog-authenticated-user-id' header and strip the 'accounts.google.com:' portion of it to just leave the id.
Pass that id and your api key to a GET request, like so:
https://content-people.googleapis.com/v1/people/${userId}?personFields=photos&key=${apiKey}
Hope this helps someone else, too!

Instagram official public_content API vs unofficial JSON API

It seems that Instagram has two means of scraping public data. There is the official API for which you need to get an API key and permissions, as described in the guide https://www.instagram.com/developer/ For a tag-specific search, the official API uses the endpoint:
https://api.instagram.com/v1/tags/{tag-name}?access_token=ACCESS-TOKEN
But it also seems that many people are scraping Instagram by using a different public API (which I think is the one accessed by the front-end of the website). This "unofficial" API uses the endpoint:
https://www.instagram.com/explore/tags/{tag-name}/?__a=1
I cannot find any information regarding support for the "unofficial" version. Does anybody know what limitations may exist on this API? If this method of retrieving data satisfies the requirements of our application, is there any reason we should still engage the rigorous API token review process to get our application approved for "official" API public_content permissions?
As far as I know
Does anybody know what limitations may exist on this API?
It is a direct violation of Instagram terms of use as in here
10.We prohibit crawling, scraping, caching or otherwise accessing any content on the Service via automated means, including but not
limited
to, user profiles and photos (except as may be the result of standard
search engine protocols or technologies used by a search engine with
Instagram's express consent).
And as a developer there is no grantee that these API remain
unchanged. so you probably experiencing system fail and be forced to
re develop parts of your code times to time.
Also it worth mentioning that users won't easily give you username
and passwords of their account, as the public API just requires
confirmation to access limited account resources.
is there any reason we should still engage the rigorous API token
review process to get our application approved for "official" API
public_content permissions?
Same as a bow

Connect Google calendar api and api.ai

So here is what i am trying to do :
I built a bot with api.ai for my business that is hosted on my webpage and my Facebook page right now. Bot works well.
I want to push it to the next step by allowing my customers to make querys on my calendar, ask to book a specific time, see if available, if not offer other time similar, then make a booking.
I have been reading this thread and the great answer attached to it but i think my case is a bit different.
I was wondering if the bot could always have a token so every guests won't have to Auth to query the calendar ?
Obviously i am new to this, i have been reading the guide of google calendar api and api.ai but i don't really see how to do that yet. I guess there is a way to store a token somewhere and then just trigger the query with some specific intents but not to sure how.
I have also done the node.js quickstart guide of the G-calendar api, and it works fine if that helps.
Thanks for your help !
You will probably want to use a Service Account that is permitted to the calendar in question. Service Accounts are similar to regular accounts, but they are expected to do server-to-server communication only, so the method to create an auth token is a little different to keep it secure.
See https://developers.google.com/identity/protocols/OAuth2ServiceAccount for more information about using Service Accounts.
In general, you'll be using a shared secret to create and sign a JSON Web Token (JWT) you send to Google's servers. You'll get back an access token which you'll then use to call the Calendar API. The access token expires in about an hour, at which point you'll need to repeat the process.
There are libraries available to do much of this for you. For example, if you're using the node.js library https://github.com/google/google-api-nodejs-client, then it will take care of this for you (although you need to modify the key file - see the documentation for details).

How to access a gmail account I own using Gmail API?

I want to run a node script as a cronjob which uses Gmail's API to poll a gmail account I own.
I am following these quickstart instructions:
I'm stuck on the first step. When requesting credentials for a cron script it tells me that "User data cannot be accessed from a platform without a UI because it requires user interaction for sign-in":
The docs are confusing in general, and mention "service accounts," "OAuth," and other things -- I cannot tell which apply to my use-case and which don't. I've used many SaaS APIs, and the typical workflow is to login to your account, get an API key and secret, and use those in your script to access the API. It seems this is not the paradigm used by the Gmail API, so I'd appreciate any guidance or links to clearer instructions.
I also find that the documentation can be confusing at times, but what you want to to is actually pretty straight forward once you get it:
Register your App at Google, and say what APIs you want your App to have access to (only the Gmail API in this case). This will give you two strings, a client_id and a client_secret (which is the content of the client_secrets.json-file above).
Since you are just going to write a script for your own account only, you don't need a http-server. The Oauth Playground will suffice. Press the Settings Cog on the top right and use your own OAuth credentials.
Select the Gmail API in the list of APIs and follow the outlined steps.
Now you have an access_token and a refresh_token you can use to keep your script going indefinitely!
To fully understand the use of Gmail API, going through Gmail API Overview really will make a difference.
And you can also use these documentations to start building a Gmail app:
The client libraries are available for download in several languages and simplify making API requests.
The developer guide topics help you better understand how to implement particular use cases.
The API reference gives you details on every resource and method in the Gmail API.
I hope these help.

Advanced Instagram-Api access for website

I am making my research for an upcoming project:
It is going to be a website you can login via your Instagram account - I need access to the user's name, profile picture and to the people he/she is following.
Is Instagram allowing a website/project to access this information?
Just in case this is a super easy question: I am not a developer and it is very hard for me to work through the Instagram developer website - I highly appreciate any help!!
Thank you very much!
Mathew
You will first need to implement the authentication part, and receive an access_token for the user. In fact you will receive user's id, username, and profile photo along with the access_token.
That was the hardest part. Then you may use the access_token to make some API calls to get information such as follows and followed-by.
You can access Name, profile photo and followers using Instagram APIs.
Here are the 2 APIs you will need:
http://instagram.com/developer/endpoints/users/#get_users
https://api.instagram.com/v1/users/1574083/?access_token=ACCESS-TOKEN
http://instagram.com/developer/endpoints/relationships/#get_users_follows
https://api.instagram.com/v1/users/3/follows?access_token=ACCESS-TOKEN

Resources