Evernote invalid token - evernote

I was making a small app for myself. Basically it will move all notes under specific folder of one account (yinxiang.com account) to another folder of another account (international account). Based on the sample code from Evernote.com, part of the code looks something like this:
source_auth_token = "xxx"
source_client = EvernoteClient(token = source_auth_token, sandbox=False)
source_note_store = source_client.get_note_store()
source_notebooks = source_note_store.listNotebooks()
I have two developer tokens, one from my yinxiang.com account, and the other from the international account. The one from the international account works just fine, but the other one from yinxiang.com doesn't. It keeps telling me:
evernote.edam.error.ttypes.EDAMSystemException: EDAMSystemException(errorCode=8, _message='authenticationToken')
Notice that I have changed sandbox=True to sandbox=False, and I have revoked the developer tokens from both accounts several time. And again, my international account works just fine. It seems to me that there's something wrong with the token from my yinxiang.com account. Even if I tried running EDAMTest.py from the sample folder with the yinxiang token, it doesn't work.
Is it because of the server of yinxiang.com or just something else?

Are you sure you're not requesting the "international" noteStore with the yinxiang token ?
Maybe you can provide more code ?

Try this for yinxiang:
client = EvernoteClient(token=yinxiang_token, service_host="app.yinxiang.com")

Related

Correct phone number format on Amplify Auth / Cognito?

I'm trying to signup to a site I created with AWS Amplify. I added Auth and clicked to allow signing in with both email and phone number. However, when I try creating an account, I get an error saying the phone number format is incorrect. So far I've tried:
+17184625510
7184625510
718-462-5510
etc
but I consistently get the following error. Any help would be appreciated!
According to AWS Cognito, The phone number must be in E.164 format. eg. "+12065550100".
This is a known bug in the Amplify UI which you can read more about in the corresponding GitHub Issue where there is also a proposed workaround for the problem that you can try until the problem is fixed.
The problem is that the +1 that is entered as a default for the country code is undefined in the code. Everything currently works if you switch from +1 to another country code (or to another country code and back to +1 again). If your users are not in the +1 region they probably won't notice, otherwise take a look at the workaround.

Avoid linking params during authentication not working in cronofy

I want to create a new account every time user authenticates via cronofy, my link is as below
https://app.cronofy.com/oauth/authorize?
response_type=code&
**avoid_linking=true**&
client_id={clinet_id}&
redirect_uri={redirect_uri}&
scope={scope}
I saw in there documentation for that we need to pass "avoid_linking" params but still every account is created as a profile in previously created account
How to make it work so that every new user is created as a separate account with a new subId
Karl at Cronofy Support here. Once the accounts are linked, we need to unlink them before avoid_linking works as you expect.
Could you please email support#cronofy.com with the email address for the accounts you'd like unlinking, and we will get that sorted for you?
Many thanks
Karl

Google calendar API: Copy conference data not working

We are trying to copy conference data from one event to other but it not working for non G-suite accounts. We are using Google.Apis.Calendar.v3 libraries for .net. Following is sample code :
Event firstEvent = service.Events.Get(calendarId, "eventId1").Execute();
secondEvent.ConferenceData = firstEvent.ConferenceData;
The same code works for G-suite accounts. Is there anything special that needs to be done for non Gsuite accounts or its not supported for them? May be we are missing something. Actually issue is instead of copy conference data it gives new conference data i.e new link, new signature even if same object is set to copy. It should give same link, same copy ConferenceData after creation, isn't it?
Any help will be appreciated. Thanks in advance!
References :
https://developers.google.com/calendar/create-events
https://developers.google.com/calendar/v3/reference/events/insert
This is an intended behavior. New events with attendees create a Conference automatically, so it's not possible to change it with the API. G Suite users don't have this limitation and can disable this option from the Admin console.

ADFS: Send user manager's email address as a claim

I integrated SSO with ADFS, and I need to get the manager's email of whoever is currently logging in. When I send over the manager attribute using:
query = ";manager;{0}"
I only get back the manager name and org.
I tried following this article:
https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/ff678048(v=ws.10)
However, the rules given in the example result in a syntax error.
and tried various methods from threads such as:
https://social.msdn.microsoft.com/Forums/expression/en-US/903e217b-a441-41d6-9400-661644820500/extract-manager-email-address?forum=Geneva
I think I need to query for the manager using their name somehow, but I am having trouble coming up with a solution. I do understand I likely need multiple rules. Can anyone shed some light on this problem?
Thank you
The following rule illustrates how you can issue a mail attribute as a “ManagerEmail” claim:
c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname"]
&& c1:[Type == "http://schemas.xmlsoap.org/claims/ManagerDistinguishedName"]
=> issue(store = "Active Directory", types = ("http://schemas.xmlsoap.org/claims/ManagerEmail"), query = "(&(distinguishedName={0})(objectClass=user));mail;{1}", param = c1.Value,
param = regexreplace(c1.Value, ".*DC=(?<domain>.+),DC=corp,DC=yourdomain,DC=com", "${domain}\username"));
Make sure that the user’s manager is in the same domain as the user, i.e. corp.yourdomain.com in the above example, and your test user does have some email specified.

Getting the error "ApiKey invalid" for hotel live prices

I'm trying to get the a list of current hotel prices but I can't get my API Key to work. I've had it for a couple days so I know it isn't too new. I even tried the example in the docs (after fixing the dates):
http://partners.api.skyscanner.net/apiservices/hotels/liveprices/v2/UK/EUR/en-GB/27539733/2016-12-04/2016-12-10/2/1?apiKey=myKey
While it worked for the demo key it wouldn't work for mine. I also tried it on the ec2 micro I'm using for testing with Python and get a response with u'{"errors":["ApiKey invalid"]}':
SKY_SCAN_URL = "http://partners.api.skyscanner.net/apiservices/hotels/liveprices/v2/"
sky_key = get_sky_scan_key()
def get_hotels(request):
entityid = request.GET['entityid']
checkindate = date_formatter(request.GET['start'])
checkoutdate = date_formatter(request.GET['end'])
rooms = request.GET['rooms']
guests = request.GET['guests']
FINAL_SKY_URL = "%s/%s/%s/%s/%s/%s/%s/%s/%s/?apiKey=%s" % (
SKY_SCAN_URL, 'US', 'USD', 'en-US', entityid, checkindate, checkoutdate, guests, rooms, sky_key)
sky_response = requests.get(FINAL_SKY_URL)
This function outputs a get request with a URL like this:
http://partners.api.skyscanner.net/apiservices/hotels/liveprices/v2//US/USD/en-US/20.7983626,-156.3319253-latlong/2016-09-07/2016-09-14/1/1/?apiKey=myKey
Any advice on what the possible issue could be would be awesome, thanks!
Edit:
To be more specific I'm looking for reasons why my API Key is invalid. I'm not familiar with skyscan and while I've added an app from the skyscanner dashboard by clicking the travel api and copied the key into my project and directly into a valid url my key is showing as bad. Are there any additional steps or things that I need to take into account?
I don't know about how you're creating the URL but it seems like it shouldn't be built that way. (most likely due to their misleading documentation)
This:
http://partners.api.skyscanner.net/apiservices/hotels/liveprices/v3/?apiKey=myKey&checkoutdate=2016-09-14&checkindate=2016-09-07&currency=USD&rooms=1&entityid=20.7983626%2C-156.3319253-latlong&local=en-US&market=US&guests=1
Should be:
http://partners.api.skyscanner.net/apiservices/hotels/liveprices/v3/US/USD/en-US/20.7983626,-156.3319253-latlong/2016-09-07/2016-09-14/1/1/?apiKey=myKey
Your code should be something like:
SKY_SCAN_URL = "http://partners.api.skyscanner.net/apiservices/hotels/liveprices/v3/"
FINAL_URL = "%s/%s/%s/%s/%s/%s/%s/%s/%s/?apiKey=%s" % (SKY_SCAN_URL, market, currency, locale, entityid, checkindate, checkoutdate, guests, rooms, apiKey)
sky_response = requests.get(FINAL_URL)
I also suggest you do some tests here.
From their help site as of 17 days ago -
https://support.business.skyscanner.net/hc/en-us/articles/209452689-Why-is-my-API-key-returning-no-results-for-hotels-
"Our Hotels API is currently being reworked, and access is not available at present. Apologies for any inconvenience, when the new API is ready for use we will update the Skyscanner for Business site, so please check back there for updates."
Unclear when this changes.
Since April 2017, skyScanner started re-working their Hotels API, thus stopping all ongoing API calls to LIVE Pricing APIs:
https://support.business.skyscanner.net/hc/en-us/articles/209452689-Why-is-my-API-key-returning-no-results-for-hotels-
Hotels and Flights Cached Pricing and Browse services still working, though I am not sure if it is enough for your business case.
It seems that Skyscanner has updated their Hotels API recently and the documentation can be found here: https://skyscanner.github.io/slate/#hotels-live-prices

Resources