I have a problem when I try to use the function similarity proposed in the academic knowledge API.
I tested the following commad to compute the similarity between two string:
curl -v -X GET "https://api.labs.cognitive.microsoft.com/academic/v1.0/similarity?s1={string}&s2={string}" -H "Ocp-Apim-Subscription-Key: {subscription key}"
The error that I get is :
{"error":{"code":"Unspecified","message":"Access denied due to invalid
subscript ion key. Make sure you are subscribed to an API you are
trying to call and provi de the right key."}}
Curl_http_done: called premature == 0
Connection #0 to host (nil) left intact
Can you tell how can I generate the Ocp-Apim-Subscription-Key?
At the moment I used the key generated automatically when I visit the following url : https://labs.cognitive.microsoft.com/en-us/subscriptions?productId=/products/5636d970e597ed0690ac1b3f&source=labs
Thank you for your help
Unfortunately, primarily not an answer to your question, but rather a warning for all with the "same" problem, who could came across the original question like me, as the question helped me to solve a very, very similar problem: check whether you are using api.labs.cognitive.microsoft.com instead of westus.api.cognitive.microsoft.com. But may be you need the opposite.
It seems the whole project has been moved inside Microsoft (see https://www.microsoft.com/en-us/research/project/academic/articles/sign-academic-knowledge-api/, I would bet that this blogpost was at the top of some "entrypoint" blog even yesterday morning, but now I am not able to find this blog, perhaps the things are changing right now) and may be the project is somewhere in the middle of the transition process and not all documentation etc. corresponds with the new state. E.g. https://learn.microsoft.com/en-us/azure/cognitive-services/academic-knowledge/home, in the submenu Reference, links to two "versions" of API which seem to be almost same except for the URLs westus.api... and api.labs..., respectively. But there seem to be no info what is the difference, which one should be preferred etc.
My original keys expired yesterday, thus I generated new ones and was not able to use them until I have changed the URL to api.labs..., thanks to your question. May be you have the opposite problem, that you still have the "old" keys, so you need to use the "old" url westus.api..., but I am not able to test it, as my original keys which worked with westus.api... are expired.
Both your query and your link where to get keys are OK and work for me. Just one additional detail: did you try the circle arrow next to the key value, which generates a new key? May be your key is somehow broken or expired and this could solve your problem. You can also try to create a completely new account at MS site.
PS: I have added microsoft-cognitive tag as MS refers to https://stackoverflow.com/questions/tagged/microsoft-cognitive from many pages related to Cognitive Services
I think you need to sign up for a free account, there is a link you can follow from here:
https://westus.dev.cognitive.microsoft.com/docs/services/56332331778daf02acc0a50b/operations/58076bdadcf4c40708f83791
Except for the invalid key, you curl-call looks right.
You need a valid subscription key to be able to make API calls.
Production key
Have a look at this page on how to created the needed services in the Azure portal and how to find the endpoint, as well as they key from there.
Trial key
However, if you just want to try out the service, you can create a temporary key here. This key is very limited in use but it should get you up and running.
Limitations are:
50,000 transactions per month, up to 20 per second.
Trial keys expire after a 90 day period.
Related
I am using the latest versions on 2sxc (11.05) and the Content App on DNN 9.06. The Content-Type for Locations does not have a field for Region (or State). Is there already something in place to account for that to get Canadian or US addresses to output normally? I realize I can add the field and then maybe use the Dropdown from Query to hook it up to DNN's list of Regions, and then modify the Views accordingly...
But that seems like a lot of work for something that might already be built in (and I just don't see it?). Or is there another easy way to tackle this?
Truth be told - we never needed that so far, so it doesn't exist.
Is this necessary for maps to work, or just another field which a standard us-address needs? I'm curious because neither outlook nor SharePoint seem to require such a field, so I never really thought about it.
BUT: if you do implement it, please do share it back with us, so we can publish it.
Note that if this is important, a possibly nicer solution would be to use a public api somewhere which provides this information, as it's most certainly more complete & up to date for this purpose. If this is the case, ping me and I'll implement a string-dropdown-from-json or something like that :)
i use the API to read my projects and tasks with C#. This works like a charm.
I read my tasks with the following endpoints.
https://quire.io/api/task/list/{project.oid}
and
https://quire.io/api/task/list/{task.oid}
However, the tasks have no references to the assigned tags. In the JSON-response the tags-property is always an empty array. But most of my tasks have at least one tag assigned.
Is this a known bug or did i miss something in the documentation?
Thanks for your Help.
I verified the api endpoints you describe. And in my case they result in the expected tags being listed per task. On both root tasks for a {project.oid} and subtasks for another {task.oid}.
Here a screenshot of what I get from command line (formatted the output using jq)
compared to the view inside quire:
So the answers to your questions...
No it's not a known bug on our side, and it doesn't look you missed anything based on your description. Maybe the URLs and results from my screenshots give you something to compare with.
If the problem persists on your side you can also contact support#quire.io with additional information you can't share in public.
I am trying to get the recent post from a particular location. using this url.
https://api.instagram.com/v1/media/search?lat=34.0500&lng=-118.2500&distance=50&MAX_ID=max_id&access_token=XXXX
So when I use this URL for the first time, I get 20 results. I obtain the max ID from the list of 20 results and modify my url .
But when I use the modified URL, I obtain the same result as the first one.
How do I go about solving this?
Contrary to what I thought, the media search endpoint doesn't return a pagination object. Sorry. It also doesn't support the min_id/max_id parameters, which is why you are having problems..
If you want to get different data you are going to have to use the time based request parameter MIN_TIMESTAMP. However it looks like that parameter doesn't work for that endpoint either (though the documentation says it is supported). Indeed, a quick search on the internet reveals it might be a long standing bug with the api.
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
I've created a plugin to create new records when a field changes on another record. I've set it all up but when I run it no records are created and CRM returns a SQL Timeout error. My code is below:
Entity contactSecurityRole = new Entity("sb_contactsecurityrole");
contactSecurityRole["sb_contactid"] = linkedContact;
contactSecurityRole["sb_contactportalsettingid"] = linkedContactPortalSetting;
contactSecurityRole["sb_portalsettingid"] = linkedPortalSetting;
contactSecurityRole["sb_portalsecurityroleid"] = linkedSecurityRole;
Service.Create(contactSecurityRole);
All the variables with a name starting "linked" are entity references to other entities, as the record is made up of lookup fields. I've done some checking and where it stops is where it comes to the actual Service.Create() part.
Can someone give me some tips on what to check so I can find why this is happening?
Update:
I've found the issue, and Greg was right it was a problem outside of the code I posted above. The issue was how I was setting up one of my "linked" variables, I was attempting to use a fetch request to retrieve a Guid for the record i needed to link to, from which I was setting up an entityreference.
The mistake I made was thinking that the fetch returned a Guid whereas it was actually returning an entityreference itself. So once I got that fixed the code ran through almost immediately. My guess was that because I was setting it up wrong, when it came to creating the entity CRM/SQL Server could enter the value so it returned the error.
Thanks for everybody's help with this
This will provide you some more clarity and the solution
I had this problem when I registerd the plugins in Sandbox in one of my CRM instances, which you should be doing, as its good practice. BUT try registering your plugins in non-Sandbox mode and than try creating a record, it might solve your issue.
It makes sense that any exception would be on the Service.Create(... part since this is the point at which the code tries to access CRM (and therefore the underlying SQL table).
Is it possible that you have other plug-ins registered which may be triggered during this process? Are you running on-premise or on-line?
I've found the issue, and Greg was right it was a problem outside of the code I posted above. The issue was how I was setting up one of my "linked" variables, I was attempting to use a fetch request to retrieve a Guid for the record i needed to link to, from which I was setting up an entityreference.
The mistake I made was thinking that the fetch returned a Guid whereas it was actually returning an entityreference itself. So once I got that fixed the code ran through almost immediately. My guess was that because I was setting it up wrong, when it came to creating the entity CRM/SQL Server could enter the value so it returned the error.
Thanks for everybody's help with this
I'm building an iPhone app that, among other things, allows the user to take and store photographs associated with locations. I am currently using the ALAssetLibrary to allow the photographs to be stored in Photos and be accessible outside the app (on a computer for instance via the built-in mechanisms). There is not a lot of technical content out there for working with the ALAssetLibrary but from what there is I have managed to cobble together a working version of this. I have had to resort to storing a dictionary of photo URLS in my app and manually detecting if the photo still exists when displaying lists of them because there does not seem to be a way to add custom metadata to an ALAsset.
What I would really like to do is add two custom metadata fields to each asset to provide it with a title and a custom id value that I can use to filter on when enumerating the asset library.
As a secondary task, I'd like the user to be able to update the title metadata.
Can it be done? At this point, I really don't think it can because the API really doesn't seem to provide the necessary methods to get/set custom metadata. I'm hoping against all odds that there is some other aspect to the AssetLibrary framework that I have not yet discovered.
At a minimum, if someone can authoritatively say "NO" then at least others might find this breadcrumb on their own trail of hope and change tack more quickly!
And, having 0 reputation I can't tag it with AssetLibrary :( wow, this day is just going downhill. FML
I've been looking over the documentation and I dont think it is possible to tack on additional fields to the ALAsset object, well you can create your own object or extend theirs but that wont help you when your pulling back assets because you'll need to init yours and populate it then.
Look I know this falls short of a really good answer but I had to try.
The ALAsset class documentation describes a property - customMetadata. This is documented to be an NSDictionary of whatever custom tags you want. Currently, however, it is not implemented in the class (I've raised a bug on Apple's developer site to bring the issue up).