Getting current location of user using Azure maps - django

I'm working on a Django project where I need the current location of the user when the user presses a certain button.
I need to do this with the help of Azure Maps. I have read their documentation. Still, I'm unable to find a way to get the user's location.
What I want is when the user presses the button the Azure maps API must return me the user's location.
1. Is it possible to get the user's location using Azure maps?
2. If yes, how can I get started ( any resource/documentation )?

Getting the users location while in a browser can be done using the geolocation API that is built into the browser, there is no need to use any other library, such as Azure Maps. If Azure Maps were to provide such a feature they would simply wrap this built in feature (this is what other mapping platforms do too). Here is some docs: https://www.w3schools.com/html/html5_geolocation.asp
Here is a code sample that uses the geolocation API with Azure Maps: https://azuremapscodesamples.azurewebsites.net/#device-sensors

This documentation is quite helpful. There are several requests you can make, one of them returns the address based on the latitude and longitude.
Here's an example:
GET https://atlas.microsoft.com/search/address/reverse/{format}?subscription-key={subscription-key}&api-version=1.0&query={query}
Just plug-in the values(format, subscription-key etc.).
format: Desired format of the response. Value can be either json or xml.
subscription-key: Azure Maps subscription key( you will get this through your Azure maps account ).
query: The applicable query specified as a comma separated string composed by latitude followed by longitude e.g. "47.641268,-122.125679".
You can use the above url( with the values plugged in ) to get the required response.

Related

Amazon Products Api

I was looking around web and amazon affilate apis, but can not find a way without scrapping amazon product pages to extract some of the data to display on my site.
I have input box where users can copy/past amazon links and I want to create preview to the product on next page using the image, price and other content and link back to the page. I saw this Amazon products API - Looking for basic overview and information, I have try to use id that I think was correct one to get data for but I got wrong result.
Example
https://www.amazon.com/Hello-Kitty-Petite-House-Complete/dp/B00I90NTCE/ref=sr_1_2
I assume this is B00I90NTCE the id.
Can someone point me to correct direction?
Well you should read the documentation for the amazon product api. Here is a link to the documentation: http://docs.aws.amazon.com/AWSECommerceService/latest/DG/Welcome.html. You can also try out the api using the scratch pad: http://webservices.amazon.com/scratchpad/index.html?rw_useCurrentProtocol=1. See also this link: http://docs.aws.amazon.com/AWSECommerceService/latest/GSG/SubmittingYourFirstRequest.html
The amazon api is RESTful which means it is stateless and it works over http. It is easy to use. you have to create a url with the required parameters. if you call this url from a programming language or copy/paste it in a browser, it will return xml. The xml will contain the product information such as product image, price, product description, amazon link etc. You can parse the xml using a suitable library for your programming language

How can I get the name of my app reliably from the Facebook Marketing Api

I am trying to retrieve my app campaigns and their associated apps with their events via my advertiser account.
The problem is that I am unable to find a unique identifier for my app in the API response.
For example the query below will get me the 'action_target_id'. This would either equal my AppId or another numeric string which I don't know what is. I am confused, does it mean I have two AppIds?
act_<AD_ACCOUNT_ID>/reportstats?time_interval={"day_start":{"day":"01","month":"03","year":"2014"},"day_stop":{"day":"07","month":"04","year":"2015"}}&data_columns=['adgroup_id', 'actions','action_target_id','action_target_name','campaign_name']&actions_group_by=['action_device','action_type']&format=json&async=true
What are 'action_target_id' and 'action_target_name' meant to represent (in the context of running a campaign for a mobile app)? I cannot seem to find a clear explanation for this in the API doc.
The applications/developer edge will return applications your account has access to.
As for your second question, the action_target_id and action_target_name are not always your application. It depends on what the action specs of each campaign is, if even set. An 'action spec' is a FB format for defining relationships between an ad and various objects for various purposes. More about that at https://developers.facebook.com/docs/marketing-api/intro-action-specs
In your case, the action spec in the context of a mobile app ad campaign will probably be the FB application. See also default conversion spec and default tracking spec.

How to query nearby addresses during reverse geocoding request

How do I find all the addresses in a small search radius for a specific geocode point? I want to display a user 5-10 address that he can pick from based on geolocation data I retrieve from his phone. I'm using Bing maps location API (http://msdn.microsoft.com/en-us/library/ff701710.aspx), but open to other APIs if this doesn't work. The documentation talks about BoundingBox as a supported location type but I'm unable to use when I tried.
The reverse geocoder will usually only return one location. Bounding boxes are not supported for reverse geocoding. To do what you are looking to do you will need to make multiple reverse geocoder requests over an area. I put together a code sample a few years back on how to do this using Silverlight. You should be able to see the logic in there and migrate it over to use the REST services and what ever programming language you are using.You can find the blog post here: http://rbrundritt.wordpress.com/2010/01/09/reverse-geocoding-over-a-search-area/

Export clearcase/quest list of users

Is there a way to export the list of clearcase/quest users?
I saw the utility in the "user administration" program but it export everything and I only need the users that use clearcase/quest for the last year.
thanks!
It seems that such an export should differ between ClearCase and ClearQuest, since only the latter has a user database (while the former -- ClearCase -- relies on system account).
You can check, for Clearquest:
"Using the ClearQuest API to access a user database"
"Querying Rational ClearQuest user databases"
ClearCase users are usually registered in a Windows group dedicated for that application (like "ClearCaseUsers").
So you could try and list all the users of that group (or any group you configured ClearCase to use) in order to get the list of ClearCase users.
What kind of list are you looking for?
You can use ClearQuest OSLC CM REST API found here (https://jazz.net/wiki/bin/view/Main/RcmRestCmApi) to issue an http request and get a XML list of all ClearQuest users:
http://localhost:8080/oslc/cqrest/repo/7.0.0/db/SAMPL/record/?oslc_cm.query=&rcm.type=users
Where:
http://localhost:8080/oslc/cqrest/repo/7.0.0/db/SAMPL/record/
is a sample base URL. You would have to figure out what your base URL is. The following API documentation helped me figure that out https://jazz.net/wiki/bin/view/Main/CqOslcV2
You just submit that request through your browser (not IE) or in code and get back an xml response with the list of users.

Get All Google Calendars Shared Within A Domain

I'm working on a script that grabs all calendars shared within a domain. I'm an admin on that domain and can grab all users within that domain, but I need help getting calendars that each user owns.
It seems that any existing solution for this problem uses deprecated versions of the Google Calendar API. I've tried to modify the raw GET request:
https://www.googleapis.com/calendar/v3/users/[username]/calendarList
That didn't work. I'm guessing it's because it's a raw request that has no information regarding the authentication.
As of now, this isn't an implemented feature:
https://code.google.com/p/google-apps-script-issues/issues/detail?id=249&q=domain%20calendar&colspec=Stars%20Opened%20ID%20Type%20Status%20Summary%20Component%20Owner