Using taken displayName to create a gallery app - microsoft-graph-api

I am using the Instantiate Application Template API to create a gallery app:
The body requires the following JSON:
{ displayName: 'customNameOfGalleryApp' }
If the displayName is already used, there is no indication in the response. We get a 201 (successfully created) status and unique IDs associated with the displayName.
Is there a way to NOT create a gallery app and issue an error if the displayName is already utilized?

The best solution I can suggest at this stage is to check if an Application Template with that name already exists.
GET /applicationTemplates?$filter=displayName eq '{appDisplayName}'
Then fail the attempt in your client code.

Related

readMask value to get the display names form new GMB API

I am running this line of code:
location_list = self.service_mbbi_v1.accounts().locations().list(parent=account_name,readMask='name').execute()
And I get the list of the location IDs but I don't manage to get the Location display name, the display name, not just the ID. I wrote google and told them about my issue and they told me they are looking into it but it has been 2 weeks and no response yet. So just wanted o see if someone else had the same issue and if they fpund a solution or a workaround.
The documentation provides only an example, not a list of possible values:
https://developers.google.com/my-business/reference/businessinformation/rest/v1/accounts.locations/list
And even when I try the example value of the readMask flag I get an error:
[{'#type': 'type.googleapis.com/google.rpc.BadRequest', 'fieldViolations': [{'field': 'read_mask', 'description': 'Invalid field mask provided'}]}]">
I found this similar question:
Google Business Profile API readMask
The example they provide work for me but I still can't get the display name value.
I thought of using the google place ID I get from the metadata response and see if I can use another API to find the name but it feels they should be a proper 'readMask' string vale for the display name here and it is not 'displayName'..
Has anyone a hint of what can I do?
Thanks a lot
If you are trying to get the business name data, your readMask should be 'title'.

Cumulocity smarREST response templates

I am trying to set up the Cumulocity smartREST response templates to supply info from the device object stored by an app. I am thinking it is not possible but I want to confirm because the documentation is brief and not clear.
I have successfully implemented MEASUREMENT POST templates previously but I am trying to do INVENTORY GET now. I have set some values in the device object and I can see them from tenant.cumulocity.com/inventory/managedObjects/id/. This could look like:
"custom_values": {
"val1": "abcde",
"val2": "fghij"
}
Now I go to the smartREST template web interface editor and create a template (eg t1) and set a message (eg m001) and set it to 'inventory' and 'get' and tick 'includes response'. I'm not sure if I need custom fields here. Then I create a response (eg r001) and I now have to fill in base pattern with a condition and some number of other patterns. I assume in one of those fields I have $.custom_values.val1 etc but all permutations I try result in 'no access to object' error from topic 's/e'.
My ideal result (from the above example) would be to publish to '/s/uc/t1' with 'm001' and receive 'r001,abcde' (ie custom_values.val1) and publish 'm002' and receive 'r001,fghij' (ie custom_values.val2).
Thanks for taking the time to read.
Your approach is correct but your MQTT user probably is just missing the rights to the object as it is created by the app (I guess the mqtt client is a device user).
The best approach here is to give this object you are creating from the app the fragment c8y_Global
{
"name": "testObject3",
"c8y_Global": {},
"custom_values": {
"val1": "abcde",
"val2": "fghij"
}
}
This fragment will make this object available to all registered users. This is common practice for app meta data.

Facebook Graph API - Tag Photo

I am trying to tag a photo using /{photo-id}/tags. These are the parameters I am sending:
{
tags = "[{'tag_uid': 'FRIENDS_ID', 'x':1, 'y':1}]";
}
This works fine if i use my App-Scoped ID, but it doesn't work with my regular ID.
This is the error that i am receiving ("(#100) The global X id is not allowed for this call"):
So, it does work with my App-Scoped ID, retrieved using /me, but it doesn't work with any other regular ID, neither mine or of my friends.
Do any of you have ideas of what's causing this?
As I already commented, you can only use App Scoped IDs in Apps, and those are only unique in your own App. You can only match them with another App you own, by using the Business Mapping API.
For tagging, you should use taggable_friends: https://developers.facebook.com/docs/graph-api/reference/v2.1/user/taggable_friends

Asana tag API query often misses newly created Tags

when we create projects via API the newly created project is immediately returned in both the webApp and in the API.
But a tag created using API "https://app.asana.com/api/1.0/tags" is often returned only after two or three GET requests. Also in the webApp it needs a refresh, online application sync does not update new tags like Projects.
This late returns really affects the user interaction. I follow the same workflow thats used for creating and adding project, but tags feels a bit laggy. Am I missing anything?
The answer is that tags which aren't associated with any tasks are - unfortunately - hidden in the app, and consequently also in the API. As you discovered, you can get the ID back from the POST to create and then associate it with a task from there (since there's little purpose in creating a tag if you're not associating it with something that shouldn't typically be a problem, but it is clunky). We are looking at changing our data model for tags to be a bit more intuitive in future, but that's still a ways off, so this is the reality for the foreseeable future.
the newly created tag is missed in the GET /tags API from time to time. But the http response returned after creation of the new tag by POST /tags, will contain the id, name and other properties of the newly created tag. So we can add the new tag from this response.
POST-> https://app.asana.com/api/1.0/tags \
-u "name=fluffy" \
-u "workspace=14916"
# Response
HTTP/1.1 201
{
"data": {
"id": 1771,
"name": "fluffy",
...
}
}

Deleting a sub organization

I am running into an issue when I try to delete sub organizations.
I get the following error (customer ID was removed)
Execution of request failed: https://apps-apis.google.com/a/feeds/orgunit/2.0/CustId/QA%2ftesting%2fmoar%2bgroups"}
I am using the Google Apps C# Library and calling it like this
OrgService.DeleteOrganizationUnit(customerID, "QA/testing/moar+groups");
The response body is "1301: Entity Does not exist"
I am taking the path directly from the feed to get all the organizations and passing it into delete and it is still failing... any idea what is going on here?
Is the name of the OU "QA/testing/moar+groups" or is it "QA/testing/moar groups"? You should be passing the true name of the OU to the library, it should take care of URL encoding it.

Resources