Docusign Powerform Activate Only 302 - salesforce

I am trying to activate a powerform link using the activate only parameter by sending a GET request from my APEX code with prefilled parameter fields. I am getting a 302 Status Found when using Http callout.
If I use that same url manually in chrome browser window however, it works fine and activates the powerform and sends emails out to listed recipients as it should.

Related

Method Not Allowed Error after redirecting in AngularJS

So what is going on is I have integrated the PayU payment gateway in my angular app. It has a success and failure url to which it gets redirected to according to the payment response. Now those urls are client's url where the client receives the response from PayU after payment success/failure. It is sent as a POST with few query parameters that are to be parsed.
Now the problem is that since the request is a POST request on a localhost url(with the same port on which I am already running the app), the console says that 'Method is not Allowed'.
The success url is http://localhost:8005/#!/payment/success
My app is running on http://localhost:8005 (which is the same).
Now I tried to define the url in app.js so as to receive the response as follows -
.state('successScreen',{
url:'/payment/success/',
templateUrl:'partials/successScreen.html',
controller:'paySCtrl'
});
but it doesn't work.
when I am redirected to the url(http://localhost:8005/#!/payment/success) after payment, I am getting that 'Method Not Allowed' error.
The same url is working with GET request though but it cannot be a GET request as it is a response from third party so cannot change it from POST to GET.
So can anyone please help me with how can I overcome this thing or a work around maybe?

AppEngine gmail - missing email in chat message

Is there any reason, why I don't get email along with chat message retrieved by gmail.users.messages.get? When I try to execute the request via API explorer I can see the email in "From" field of the MessagePartHeader, however when I try it programmatically, the email is missing (using the same paramters as in API explorer).

getting ng-token-auth and devise_token_auth to work with OAuth in ionic InAppBrowser

When I test the setup on my laptop Chrome browser everything works just fine using both sameWindow and newWindow: I am able to login though for example Facebook and the user is authorized and can use my app.
However, when I try to deploy the app to android and use the inAppBrowser things break. When selecting the 'login through FB' button in my app I can see the inAppBrowser frame come up with the Facebook mobile site asking to login. When I inspect that specific window through Chrome inspect, I can see that the callback from FB coming in to omniauth on my server including state and code in the querystring:
https://<app>.herokuapp.com/omniauth/facebook/callback?code=<code>&state=<state>
This request receives a 302 redirect to the following URL:
https://<app>.herokuapp.com/api/v1/auth/facebook/callback
This follow-up request receives a 200 response. So far it all seems fine and the inAppBrowser window closes, we get back to my mobile app and I see the ng-token-auth "auth:login-success" event passing by.
However, any subsequent API requests to my server receive a 401 Not Authorized response. When I look at the request headers of those API requests I don't see any of the headers that Chrome on my laptop is sending to the server such as: access-token, client, expiry, token-type and uid.
I would be very grateful for any advice on where to look or what I am missing here.
Thanks!
Turns out that when working with ionic and I assume it is the same with cordova, storing the tokens according to default behavior in the cookie does not work. However, once you configure it to work with localStorage it works great!
For more info see this issue I opened at the GitHub project.

Docusign redirection

I'm building an integration between my application and Docusign. This is flow:
Log in to Docusign with credentials. OK
Getting envelope from Docusign. OK
Getting Recipient View URL. OK
Open with received URL. OK
User signs/declines document. OK
Redirect to given URL. (when I build request I have set up a return URL)
I'm using API call : Recipientv2/accounts/:accountId/envelopes/:envelopeId/views/recipient (http://iodocs.docusign.com/#)
Everything is fine except step 6.
When using this flow in my application I get this error in FF:
Load denied by X-Frame-Options:
http://localhost:8080/#/land/10000?event=decline does not permit
framing.
In Chrome I get:
Refused to display 'http://localhost:8080/#/land/10001?event=decline'
in a frame because it set 'X-Frame-Options' to 'DENY'.
I'm using tomcat, spring, angularJs, ....
Any hints?
Thanks
The problem you are running into is not related to DocuSign at all - the page you are trying to display in an iFrame is set to not allow displaying in iFrame.
You need to set the X-Frame-Options header on the localhost page you are trying to re-direct to:
X-Frame-Options SAMEORIGIN, GOFORIT

Twitter oAuth redirects to 404, but only the first time

Using twitter4j v3.0.3, every aspect of Twitter integration works, except that when authenticating/authorizing my, the browser is redirected to http://api.twitter.com/login which returns "Sorry, that page doesn’t exist!"
This only happens THE FIRST TIME, i.e.browser with a clear cache or an Incognito window. My server reports that it's redirecting to this URL...
http://api.twitter.com/oauth/authenticate?oauth_token=PTlVt6aisFy7UytjsRM5poFHcdGEjGtgNpxhJ8UbQ
...the browser confirms a 302 to...
https://api.twitter.com/oauth/authenticate;jsessionid=pw65se84inj9?oauth_token=PTlVt6aisFy7UytjsRM5poFHcdGEjGtgNpxhJ8UbQ
...and that request generates a 302 to the page which does not exist, i.e.
https://api.twitter.com/login?redirect_after_login=%2Foauth%2Fauthenticate%3Bjsessionid%3Dpw65se84inj9%3Foauth_token%3DPTlVt6aisFy7UytjsRM5poFHcdGEjGtgNpxhJ8UbQ
When the user navigates back from the "Sorry, that page doesn’t exist!" page and then retries, the oauth flow works perfectly.
I'm guessing this is something to do with the appended jsessionid?
This issue is on local development server, but the 404 has also been seen intermittently on GAE production.
I found the solution here: https://stackoverflow.com/a/19690688/2698327
You identified correctly the problem: GAE append a jsessionid parameter for the first request made by a user (i.e. when the session is created).
To prevent it from doing so you can edit the web.xml and append the following:
<context-param>
<param-name>org.mortbay.jetty.servlet.SessionURL</param-name>
<param-value>none</param-value>
</context-param>
To be correctly authenticated, you should send appropriate parameters via query parameters in the link such as: consumer key, consumner secret key, access token and access token secret.
If you still get the same page not found error, maybe the twitter account that associated with the authentication parameters was deleted!

Resources