How can update roomle component via roomle API? - roomle

I'm following docs of roomle at https://docs.roomle.com/rapi/endpoints/Component.html#post
but I dont see any example for the body content of update method.
And I got an error message when update a component
{
"error": {
"type": "BAD_REQUEST",
"message": "you need to be in cms context",
"status": "BAD_REQUEST",
"statusCode": 400
}}
My body request -
PUT: https://api.roomle.com/v2/components/component_test
{
"component": {
"externalIdentifier": "component_test",
"catalog": "delife",
"id": "delife:component_test",
"configuration": "{\"id\":\"delife:component_test\",\"parameterGroups\":[{\"key\":\"chairGr\",\"global\":true,\"labels\":{\"en\":\"Sitzschale1\"}}]}",
"active": false,
"version": 3
}}
P/s: with the api to get component detail work good

Actually, the intended way is to use the Rubens Admin (admin.roomle.com) interface for posting catalog changes. Please refer to https://docs.roomle.com/web/datamanagement/ for documentation on Rubens Admin.

Related

Unable to get teams message attachment content using graph API

I am able to get message attachment information as shown below but unable to download the file content which is stored in share point site.
"attachments": [
{
"id": "fc323b65-2cee-48d9-9574-0e26eb74e9bb",
"contentType": "reference",
"contentUrl": "https://otdeveloper.sharepoint.com/sites/Test/Shared Documents/General/1Ex.txt",
"content": null,
"name": "1Ex.txt",
"thumbnailUrl": null
}
]
I am using the following get call for the above request with auth token
GET https://graph.microsoft.com/beta/groups/{{TeamId}}/drive/root:/Test/Shared Documents/General/1Ex.txt:/content
I tried the solution posted in
https://github.com/microsoftgraph/msgraph-sdk-javascript/issues/200
but I am getting 404 response.
Could you please check Get message API.You will receive the the attachments info in the response as shown below

MS Team[BETA] API for Message object property type for reaction

I am trying to create the schema for Message API
As per the documentation, the sample response properties for reaction provided are below
Documentation sample response
"reactions": [
{
"reactionType": "like",
"createdDateTime": "2019-01-21T19:55:51.893Z",
"user": {
"application": null,
"device": null,
"conversation": null,
"user": {
"id": "e1ecb745-c10f-40af-a9d4-cab946c80ac7",
"displayName": null,
"userIdentityType": "aadUser"
}
}
}
]
From the documentation user is Identity type identity set
Identity is of type:
{
"displayName": "string",
"id": "string",
"tenantId": "string",
"thumbnails": { "#odata.type": "microsoft.graph.thumbnailSet" }
}
From the sample response as well as the response from endpoint, tenantId is not present.
There is a difference in sample response/actual endpoint response and documented properties:
The one with tenantId or one without tenantId.
The user is 1 level as per property documentation but as per actual response and sample response user property has user with in.
What is the correct schema of reaction property that we should consider, because we see variation in documentation vs actual response ?
ok, I think I understand - you're just asking what you should be coding for / expecting, when you query the api. It looks to me like the first link you've posted is the more correct, but you can verify this by using the Graph Explorer. This response does NOT bring back "tenantId", but you haven't explained if you -need- tenantId. If so, there are other ways to get it.
#KritikaVohra, Consider the response that you receive from the https://graph.microsoft.com/beta/teams/{id}/channels/{id}/messages. You don't need tenant id here. in case in conversation if you need it, you can use it from turnContext.

Microsoft Graph - Accessing /me or /user/{id}/ endpoints using client_credentials flow - requested user is invalid

We're using the client_credentials flow to get access for our application to tenants environments. The application has the correct scopes, and we get an access token that is working for other endpoints like /users but when doing a request like the following we get error messages.
GET https://graph.microsoft.com/beta/me/findRooms
{
"error": {
"code": "ErrorInvalidUser",
"message": "The requested user '{userId}#{tenantId}' is invalid.",
"innerError": {
"request-id": "b72d26a3-d0ad-42eb-a3d3-35951cb42b3d",
"date": "2020-01-21T10:21:28"
}
}
}
I understand that there's no "me" when we're just an application, but how do we access these types of endpoints in that case? Do I have to have a user to act as, as well? That seems to me like it defeats the purpose of a daemon like this. Cannot find any clear documentation on this matter. On this page in the docs on the use a token section they even refer to a /me endpoint, which is incorrect in that case.
I've tried requesting the /users/{id}/findRooms endpoint with all different kinds of ID's I can find in the access token - none of them work.
Other people with the same issue, that have yet to resolve it.
1. Feedback area in docs
2. Github issue
Best regards,
Christopher
Using the /users/{user-id} is the only pattern that will work with client credentials. In your case, this should work, so maybe it's an issue with the id you are using.
To make sure I'm not giving you bad information, I just tested this with an app-only token from the client credentials flow. Parsing that token over at https://jwt.ms, I see the roles claim like so:
"roles": [
"User.Read.All"
]
If first did a GET /users?$select=displayname,id, and this user was included in the response:
{
"displayName": "Adele Vance",
"id": "3103c7b9-cfe6-4cd3-a696-f88909b9a609"
}
This is the id to use in your findRooms call. I did GET /users/3103c7b9-cfe6-4cd3-a696-f88909b9a609/findrooms and got the following response:
{
"#odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(microsoft.graph.emailAddress)",
"value": [
{
"name": "Conf Room Adams",
"address": "Adams#M365x330971.onmicrosoft.com"
},
{
"name": "Conf Room Baker",
"address": "Baker#M365x330971.onmicrosoft.com"
},
{
"name": "Conf Room Crystal",
"address": "Crystal#M365x330971.onmicrosoft.com"
},
{
"name": "Conf Room Hood",
"address": "Hood#M365x330971.onmicrosoft.com"
},
{
"name": "Conf Room Rainier",
"address": "Rainier#M365x330971.onmicrosoft.com"
},
{
"name": "Conf Room Stevens",
"address": "Stevens#M365x330971.onmicrosoft.com"
}
]
}

Microsoft graph not creating embed link for file

While posting request to microsoft graph:
POST 'https://graph.microsoft.com/v1.0/me/drive/root:/017_2018-08-12_18.47.27.jpg:/createLink'
content-type': 'application/json
{
"type": "embed"
}
I am only getting
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#permission",
"#odata.type": "#microsoft.graph.permission",
"id": "5o98ENjWYH2pNK8wO5_d7QHUrdk",
"roles": ["read"],
"shareId": "s!AgDP2w-bgvZL****evpaN2yel",
"link": {
"type": "embed",
"webUrl": "https://onedrive.live.com/embed?resid=4B****U"
But according to documentation, I should also get WebHtml with Iframe link not only webUrl, and this is what I am looking for so I can generate links for photos, and put them on website.
Am I doing something wrong or is there any way around so I can get same embed url that I can generate from manualy clicking in onedrive?
I'm using personal one drive account.
Trying this out on the graph explorer does not work on the v1.0 endpoint for me. However using the beta endpoint does indeed return the webHtml property like as follows
Essentially what you would need to do is change the v1.0 segment in the url to beta.
POST 'https://graph.microsoft.com/beta/me/drive/root:/017_2018-08-12_18.47.27.jpg:/createLink'
content-type': 'application/json
{
"type": "embed"
}
And you should get back something like this
{
"#odata.context": "https://graph.microsoft.com/beta/$metadata#permission",
"#odata.type": "#microsoft.graph.permission",
"id": "p6z1ZAtRqKFwqHNVfaa6mPFQIyI",
"roles": [
"read"
],
"shareId": "s!AorKRTkoJljsixZbAANWreQhS7gk",
"expirationDateTime": "0001-01-01T00:00:00Z",
"hasPassword": false,
"link": {
"type": "embed",
"webUrl": "https://onedrive.live.com/embed?resid=EC5826283945CA8A%211430&authkey=!AFsAA1at5CFLuCQ",
"webHtml": "<iframe src=\"https://onedrive.live.com/embed?resid=EC5826283945CA8A%211430&authkey=!AFsAA1at5CFLuCQ\" width=\"98\" height=\"120\" frameborder=\"0\" scrolling=\"no\"></iframe>"
}
}

Simple swagger specification, to retrieve an html web page

I'm new to swagger, and I'm trying to make a very simple specification, with only a get method in order to retrieve a web page, this is the code:
{
"swagger": "2.0",
"info": {
"title": "example",
"description": "Sample api to retrieve a web page.",
"version": "0.1"
},
"host":"example.org", #"localhost:8080",
"schemes": [
"https"
],
"paths": {
"/":{
"get":{
"summary":"Return the web page.",
"description":"",
"produces":["text/html"],
"responses":{
"200":{
"description":"OK",
},
"400":{
"description":"Bad request"
},
"404":{
"description":"Not Found"
}
}
}
}
}
}
I'm using the swagger online editor.
Unfortunately when I execute the request, it did not return the web page and no one of the status code that I have implemented in the specification, it return me in the detail section the error:
TypeError: Failed to fetch
Someone can tell me where I'm wrong?
Thank you.
For the "Try it out" button to work in the Swagger online editor, your API endpoints must be CORS-enabled. That is, your server (example.org or localhost:8080) must be configured to return certain response headers that would allow editor.swagger.io to make cross-domain requests to your server. This is explained in more details here:
https://github.com/swagger-api/swagger-ui#cors-support
The way to configure CORS depends on the server/framework used to host the app. This page has instructions for some common web servers:
https://enable-cors.org/server.html

Resources