Netsuite Token Based Authentication (TBA) with PHPToolkit? - netsuite

Does anyone have a working sample using Token Based Authentication with the Netsuite PHP Toolkit (Version 2017_1)? I have it working with User/Request based authentication using the sample files but need to move over to token based. I have generated both the consumer and user-based keys, and the integration works with my user/password.
I keep getting the error of "Your connection has timed out. Please log in again." The keys generated are brand new. Does anyone have any trouble with this integration that sounds similar to this?

Try creating a new login passport before each request made to the NetSuite API.
I work with C#, but had the same issue when I initially switched over to TBA. I have a method which creates the token passport and adds it to my NetSuite service object. I then call this method before each API call.
I hope this helps!

Related

Constant Contact V3 API add new contact

I'm attempting to use the new Constant Contact V3 API to add a new email contact. I've been reading the docs: https://v3.developer.constantcontact.com/api_guide/client_flow.html, and trying it out and it seems like the only way to do this now is to make an authentication request, approve the request and then retrieve and access token that is valid for only 2 hours.
I need to have access from my server only and just send an add contact request to Constant Contact. I don't understand why I require to have a redirect uri now and an access token to use the V3 api instead of just using the api key.
With the V2 api I was able to make these types of requests directly from the server without hassle and that's exactly what I need now. The V2 documentation seems to be taken down so I can no longer do that so I'm stuck.
Any help is appreciated.
Based on this link: https://community.constantcontact.com/t5/Developer-Support-ask-questions/v2-or-v3-API-for-very-basic-integration/m-p/324777#M11434, it seems like server-to-server auth is not available still. For those of you who have the same issue, use Mail Chimp or another service that has basic api requirements.
You can get INITIAL Access Token without any code - just use your browser and curl. The Access Token is valid for 24 h, but you can automatically renew it using Refresh Token. You can renew it automatically every time it expires and never need to proceed through INITIAL flow over again. You can read about it here. If you are using C#, I have templates and instructions exactly for your scenario here: https://github.com/mikeks/constantcontact-v3.

Netsuite API authenticate validation

I have sample mobile app with username and password authentication,need to valid my sample app username & password exists in netsuite based website. Please provide API info and steps to access netsuite based user info to valid my app login, currently we are using nodeJS API in app. I mean if signup/existing customer from my app would exists or not in netsuite based website
Any help appreciated !
If you are trying to log in as a customer or employee you need to ensure the records have login access, and credentials set, in NetSuite.
Not completely sure from your post if you are trying to log them in, or just access your NetSuite instance and see if they exist in the NetSuite instance, though.
Can you provide more information, and clearly state what you have tried? Code samples are a very nice thing to include, along with the errors you are receiving.

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).

PayPal Rest API - 401 when creating an invoice

I'm getting a 401 error when I try to create a PayPal invoice. I'm using the nodejs REST API:
https://github.com/paypal/rest-api-sdk-nodejs
I did a quick test with the create invoice sample, changing the id and secret in the configure.js to those my app in sandbox. I get the 401 when this happens as well. The app is setup to allow invoice actions (it's in the scope parameter when I request the token), is there something else I need to enable?
I contacted PayPal technical support, they said to contact PayPal MTS. When I contacted them they said to contact technical support... I'm assuming it's something account related as that's the only thing I changed in the sample.
Edit 2014-09-17
I can get a token with curl:
{"scope":"https://uri.paypal.com/services/applications/webhooks https://uri.paypal.com/services/invoicing openid https://api.paypal.com/v1/payments/.* https://api.paypal.com/v1/vault/credit-card/.* https://api.paypal.com/v1/vault/credit-card","access_token":"A015QDaSWWVrhK.FNSZVZd-vDGflSm.g1H.4PnDeXaYDFqo","token_type":"Bearer","app_id":"APP-80W284485P519543T","expires_in":28800}
I'm using the samples from github (configure.js and invoice/create.js specifically) the only thing I changed was the client and secret in configure.
The e-mail in the request was the issue. It worked with the sample because it was the e-mail associated with the app. Changing the config id and secret to mine wasn't enough, the e-mail needed to be changed to mine as well.
Just spent a couple of hours trying to solve this very issue. The answer Dave gave above led me on the right track.
The "merchant e-mail" in the request has to be the Paypal Sandbox Developer Account associated with the REST API app in question. I hope this helps someone.
Below is a screenshot highlighting the property in Visual Studios and PostMan.

Google Wallet OpenID

I'm working on an HTML5 App for the Chrome Store and intend to use google wallet for micro transactions. Implementation looks straight forward except I'm not sure how to identify the user on the post message after a successful transaction. I'm assuming I will need to use the open ID flow to obtain the user information so I can record the transaction in my database but was hoping I'm missing something and there's a simple way for the wallet SDK to also post the user Google OpenID?
Looks like the application needs to request the openid itself since there appears to be no session information returned about the current openid

Resources