SendGrid User Authorization from iOS App - ios

I am trying to add email contact to my SendGrid Account List, but am unable to authenticate from the iOS App. I have tried authentication from https://sendgrid.com/docs/API_Reference/Web_API_v3/How_To_Use_The_Web_API_v3/authentication.html but getting 404 NOT Found Error. To add contact to a list, I need to hit https://sendgrid.com/docs/API_Reference/Web_API_v3/Marketing_Campaigns/contactdb.html#Add-a-Single-Recipient-to-a-List-POST API referenced here, but its returning "Authentication Required".

Got it. Answer to my question is SendGrid API v3 Documentation i.e. https://sendgrid.com/docs/API_Reference/api_v3.html. Need to send the API key in request headers.

Related

Sign In With Slack - Invalid scopes: identity.basic, identity.avatar

I've set up my slack app to be installed using Oauth2.0 successfully calling
https://slack.com/oauth/v2/authorize?client_id=<myAppsClientId>&scope=chat:write,commands,incoming-webhook,users:read&user_scope=chat:write,users:read
but when i try to use Sign In With Slack (So user can manage their slack on my web app) I use
https://slack.com/oauth/v2/authorize?scope=identity.basic,identity.avatar&client_id=<myAppsClientId>
The user gets the error on the slack url (before being redirected to my app):
Error details
Invalid permissions requested
Invalid scopes: identity.basic, identity.avatar
Since the add to slack and sign in with slack both call the same uri, im assuming the scope params are what separate the two. Not sure where Im going wrong because I followed the docs and used the button they generated for me.
I don't know that this is the correct fix, but I encountered the same issue and I was able to get it working by renaming the 'scope' parameter to 'user_scope'
Ok I actually was able to get it to work by NOT using v2 for Sign In With Slack. But I HAD to use v2 for Add to Slack.
So using /oauth/v2/authorize and /api/oauth.v2.access for add to slack
and /oauth/authorize and /api/oauth.access for signin with slack
I don't think it should work like this but it's the only combo that's working.

Online meeting using Microsoft Graph API

I am working on an Angular 7 application that uses GraphAPI. I am trying to create an online meeting from this application.
Each time I send a POST request I get 'Forbidden' as response. I have used apis's with Delegated permission before and it works.
Since online meeting requires 'Application Permission' I am not sure where to specify it. Could anyone help me with this?
You specify the permissions in App Registration > your app > settings.
You have a problem with the way you are trying to access the token. I used to get the same error however, got resolved by passing userName and Password as well in the auth request and using grant_type as password.

How to get followers list from Twitter?

I am trying to call following Twitter's API to get a list of followers for a user.
http://api.twitter.com/1.1/followers/ids.json?cursor=-1&screen_name=username
And I am getting this error message in response.
{
code = 215;
message = "Bad Authentication data";
}
I can't seem to find the documentation related to this error code. Anyone has any idea about this error?
Your request lacks authentication data. I got that error when I simply clicked on http://api.twitter.com/1.1/followers/ids.json?cursor=-1&screen_name=username. This is not the way to access twitter API.
Create a Twitter app from https://apps.twitter.com/. Then, try using a Twitter API Library to access REST API. If you are comfortable with using ruby apps on command line interface check out https://github.com/sferik/t. Set it up and then try t followers [USER] for listing all followers of USER.
You will have to use OAuth. More info can be found on Twitter website. Here: https://dev.twitter.com/oauth
This error is coming because your Twitter developers account is not approved. Now-a-days you can't make app without getting your developers account approved from Twitter.
To make an app, you need to contact Twitter and apply for developers account. If you are lucky engough, you will get approval although this process may take months.
If you just need the data, go for third party services like followersanalysis[dot]com, birdsonganalytics[dot]com

Twitter API issues.“Authentication needed”"Failed to validate oauth signature and token"

Friends,I got a question,and I have googled it,but I didn't find the answer.
I create an iOS twitter app,and apply for a twitter API.
I used my API key in my app,Xcode returns error.
Just like this: http://tinypic.com/r/262ksnk/8
("Failed to validate oauth signature and token")
and this picture is my twitter api status
(sorry,I do not have enough coin to upload a pic,so post my pic here. )
what is wrong with my twitter api,can anyone help me?
Thanks very much.
What is wrong?
Best regards.
This error message relates to a HTTP 401 response.
Please make sure you are properly signing your OAuth requests. This guide will help you with the common pitfalls: Troubleshooting OAuth 1.0A.
In particular, if you are using valid keys and properly signing your OAuth requests but still receiving 401 errors, please check your system time. Since the OAuth signature relies on the current time, it must be in sync with the one from Twitter servers (exposed in all Date response headers from the Twitter API).
The "performance issues" described on the Twitter API status page apply to Twitter as a whole, and have nothing to do with your application. If you are having issues interacting with the Twitter API, we cannot diagnose those from the information provided ("error 3").

iOS facebook SDK 3 > Get the signed request

I try to get the signed request to login the user via a webservice but I only have access to the accessToken on FBSession.
I saw this link
Facebook Signed Request for iOS (HMAC SHA256)
who shows how to convert the signed_request but doesn't show how to get it.
Need help :)
If I undersand you right you want your app to login and then make a call to a server where you need to check the users credential again.
I used this tutorial for the authentication.
Then when I call the server I send the accessToken property as a parameter to check the users credentials on the server. You can get the token value like this:
FBSession.activeSession.accessToken
On the server side you can then set the access token to the value you got from the app.
I compiled a gist that generates a signed request which you can then use to authenticate a user on your server without having to query the graph API.
You can find it here: https://gist.github.com/3962188
You can find the original question I compiled it for here: Facebook iOS SDK to return a signed request object upon login
Please note that most of the code is simply a compilation of existing open source code, but I haven't seen any fully working implementation like this anywhere.

Resources