Where are Exchange Web Services: ExtendedPropertyDefinition IDs defined? - web-services

In researching how to use Exchange Web Services, I see examples like this
Dim PR_DELETED_ON As New ExtendedPropertyDefinition(26255, MapiPropertyType.SystemTime)
Dim PR_SEARCH_KEY As New ExtendedPropertyDefinition(12299, MapiPropertyType.Binary)
That first parameter is an int that represents the property ID. Can anyone give me a pointer to where those ID numbers are defined?

Those are called Microsoft Exchange Property Tags and can be found here

Have a look at Outlook Spy. It can tell you those numbers. There is a screen shot on that site that shows how to get them.

Related

How to provide autocomplete street addresses functionality in django?

Is there any way to provide automatic street address suggestion when user tries to enter their address in the input box using so they start getting automatic address suggestions in django.
I was searching autocomplete light but could not find specially anything related to that.
I've implemented this functionality with Google's Place Autocomplete. The sample code in the link is pretty spot on from memory.
https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform
You could use python to make the requests yourself and implement some light javascript to fill your inputs:
This will return you a list of predictions based on the input address you supply. You just need an address and your API key to run the query, but note in my example I'm using the components/types parameters as well.
here's the documentation: https://developers.google.com/maps/documentation/places/web-service/autocomplete
url = f'https://maps.googleapis.com/maps/api/place/autocomplete/json?input=<address>&components=country:us&types=address&key=<your key>'
r = requests.get(url)
predictions = r.json()['predictions']
for p in predictions:
print(p['description'])
print('-----------------------')

Use REGEX to generate multiple conversions per session in Google Analytics?

I've got a client with a real estate Website. Based on comparing goal completions to unique page views, it's pretty clear that some visitors inquire about multiple properties during a single session (more unique pages matching the REGEX string than completed goals). As goal tracking is set-up now, only one conversion per session is being completed (which I know is standard for GA).
I am using the destination as the confirmation of goal completion.
"Thank you" pages for conversions look like this:
/Enquiry/Thank-You/?subject=B30794&market=sale
/Enquiry/Thank-You/?subject=B36930&market=rental
My goal tracking REGEX is \Q/Enquiry/Thank-You/\E
I'm pretty sure that I can get Google Analytics to count more than one "thank you" as a completed goal during a session if I can account for the variable in the middle (B30794, B36930, etc.) plus the sale or rental on the end of the URL
I've asked around, including Google's GA community but can't get an string that works to handle the variable in the middle. These are two tags recommended to me that have not worked:
This string returns zero results:
^/Enquiry/Thank-You/\?subject=.*&market=(sale|rental)$
This string returns more than simply the thank you URLs:
^/Enquiry/Thank-You/\?subject=.*&market=sale|rental$
Try this one, the issue for the empty one was that the characters were not escaped:
^\/Enquiry\/Thank\-You\/\?subject=.*&market=(sale|rental)$

Is there an easy way to fake a Sitecore Device for testing?

We have a custom device set-up in a Sitecore installation. Is there an easy way to get my desktop to render that?
I'd imagine there should be a nice parameter sc_device= we can tag onto the url, but it doesn't seem so
Using sc_device is exactly what you need. Just make sure that you use device item id, not name, e.g.:
http://localhost?sc_device={46D2F427-4CE5-4E1F-BA10-EF3636F43534}
sc_device is correct. Your problem must lie elsewhere; like suggested maybe your device has not been published etc.
Nice article documenting Sitecore Querystrings here: http://sitecoreblog.patelyogesh.in/2013/07/sitecore-query-strings-parameters.html
Did you create new device under /sitecore/Layout/Devices ? Did you also set query string field on the new device (something like ?d=m ) ? Did you publish devices,layouts, etc ?

Correct yummly API call for a recipe

I'm trying to use the Yummly API. I've noticed that some of their developers have answered other questions here, so I'm hoping to catch their eye. I used the documentation at the yummly developer site https://developer.yummly.com/documentation#IDs.
Specifically here is my get request:
<http://api.yummly.com/v1/api/recipe/Avocado-cream-pasta-sauce-recipe-306039>
Which returns this:
Please include X-Yummly-App-ID and X-Yummly-App-Key
Seems like this is a sensible thing, except that I don't see anywhere in the documentation for the single recipe call where I'm supposed to insert that info. Any one out there know how to properly format this?
or include them as URL parameters:
_app_id=app-id&_app_key=app-key
https://developer.yummly.com/documentation#IDs
Try this:
http://api.yummly.com/v1/api/recipe/Avocado-cream-pasta-sauce-recipe-306039?_app_id=ID&_app_key=KEY
You need to take the URL you mentioned in the question and add your authentication parameters to it. So it becomes:
http://api.yummly.com/v1/api/recipe/Avocado-cream-pasta-sauce-recipe-306039?_app_id=ID&_app_key=KEY
Instead of ID and KEY insert the application id and key from your account on developer.yummly.com

RESTful API and Foreign key handling for POSTs and PUTs

I'm helping develop a new API for an existing database.
I'm using Python 2.7.3, Django 1.5 and the django-rest-framework 2.2.4 with PostgreSQL 9.1
I need/want good documentation for the API, but I'm shorthanded and I hate writing/maintaining documentation (one of my many flaws).
I need to allow consumers of the API to add new "POS" (points of sale) locations. In the Postgres database, there is a foreign key from pos to pos_location_type. So, here is a simplified table structure.
pos_location_type(
id serial,
description text not null
);
pos(
id serial,
pos_name text not null,
pos_location_type_id int not null references pos_location_type(id)
);
So, to allow them to POST a new pos, they will need to give me a "pos_name" an a valid pos_location_type. So, I've been reading about this stuff all weekend. Lots of debates out there.
How is my API consumers going to know what a pos_location_type is? Or what value to pass here?
It seems like I need to tell them where to get a valid list of pos_locations. Something like:
GET /pos_location/
As a quick note, examples of pos_location_type descriptions might be: ('school', 'park', 'office').
I really like the "Browseability" of of the Django REST Framework, but, it doesn't seem to address this type of thing, and I actually had a very nice chat on IRC with Tom Christie earlier today, and he didn't really have an answer on what to do here (or maybe I never made my question clear).
I've looked at Swagger, and that's a very cool/interesting project, but take a look at their "pet" resource on their demo here. Notice it is pretty similar to what I need to do. To add a new pet, you need to pass a category, which they define as class Category(id: long, name: string). How is the consumer suppose to know what to pass here? What's a valid id? or name?
In Django rest framework, I can define/override what is returned in the OPTION call. I guess I could come up with my own little "system" here and return some information like:
pos-location-url: '/pos_location/'
in the generic form, it would be: {resource}-url: '/path/to/resource_list'
and that would sort of work for the documentation side, but I'm not sure if that's really a nice solution programmatically. What if I change the resources location. That would mean that my consumers would need to programmatically make and OPTIONS call for the resource to figure out all of the relations. Maybe not a bad thing, but feels like a little weird.
So, how do people handle this kind of thing?
Final notes: I get the fact that I don't really want a "leaking" abstaction here and have my database peaking thru the API layer, but the fact remains that there is a foreign_key constraint on this existing database and any insert that doesn't have a valid pos_location_type_id is raising an error.
Also, I'm not trying to open up the URI vs. ID debate. Whether the user has to use the pos_location_type_id int value or a URI doesn't matter for this discussion. In either case, they have no idea what to send me.
I've worked with this kind of stuff in the past. I think there is two ways of approaching this problem, the first you already said it, allow an endpoint for users of the API to know what is the id-like value of the pos_location_type. Many API's do this because a person developing from your API is gonna have to read your documentation and will know where to get the pos_location_type values from. End-users should not worry about this, because they will have an interface showing probably a dropdown list of text values.
On the other hand, the way I've also worked this, not very RESTful-like. Let's suppose you have a location in New York, and the POST could be something like:
POST /pos/new_york/
You can handle /pos/(location_name)/ by normalizing the text, then just search on the database for the value or some similarity, if place does not exist then you just create a new one. That in case users can add new places, if not, then the user would have to know what fixed places exist, which again is the first situation we are in.
that way you can avoid pos_location_type in the request data, you could programatically map it to a valid ID.