Not able to provision IOT device under specific Device Template in Azure IoT Central - azure-iot-hub

Recently I saw that in IoT Central app if I create a new Device Template, we get a Interface id in the format like this "dtmi:iosIotCentralApp:DeviceTestTemplate21i;1". And if I use this for DeviceProvisioning function as cmid then I am getting below error in Azure function "Please follow the schema if you want to pass __iot:interfaces section under data. Format: '__iot:interfaces':{'CapabilityModelId': urn:companyname:template:templatename:version, 'CapabilityModel': 'The inline contents of interfaces and capability model.'}"
If I manually create cmid in format (urn:companyname:template:templatename:version) Device is provisioned but not assigned to the specific Device Template.
I am using below API for registration in an Azure function
PUT https://global.azure-devices-provisioning.net/{idScope}/registrations/{registrationId}/register?api-version=2019-03-31
Are there any changes in API for Device provisioning or am I missing anything?

This question is related to my answer here.
The following is a DPS payload for passing the model id:
{
"registrationId":"yourDeviceId",
"payload": {
"modelId": "yourDeviceTemplateModelId"
}
}
See more details in the IoT Plug and Play device developer guide.

Related

Revit API : SaveAsCloudModel failing with exception : Cloud model Entitlement

One one particular BIM360 hub the API: Autodesk.Revit.DB.Document: SaveAsCloudModel(Guid accountId, Guid projectId, string folderId, string modelName) throws the exception:
You do not have cloud model entitlement to access this resource in cloud. Many other hubs call this without any issues.
The user can manually save to the same exact bim360 project/folder combination with the same file on the same machine.
The rights were checked in the manage.autodesk.com as BIM Collaborate Pro for the user and admin rights to all projects.
The ids are correct. In the journal, before the api call: Utility.getEntitlement: The entitlement is Skyscraper is found.
Solved the issue privately, but append the details here to help others.
Actually, the user has Skyscraper (workshared cloud model) entitlement, but the user doesn't have Single user entitlement.
The user created a non-workshare cloud model and wanted  to convert it workshared cloud model, but it failed at the 1st step to save the non-worksharing model because he did not have Single user entitlement .
The suggestion is:
Enable worksharing locally (like he enable a worksharing in revit local file);
Call saveAsCloudModel API.

Add parameter in Firebase Dynamic Link created thru console

I have an Expo/React Native app and I'm trying to implement Firebase Dynamic Links so that I can connect two users. So, user A would provide a dynamic link to user B. If user B doesn't have the app already installed, the link would send the user to App Store or Google Play for it to be installed. Once the installation is completed, the app would open up and retrieve user A's ID. If user B already has the app installed, the dynamic link would simply open the app and retrieve user A's ID.
Here's my question: if I define a dynamic link through the Firebase console, can I add parameters to it in my app? In other words, simply use the dynamic link on the console and add user A's ID to it.
Or if I need to send parameters that will depend on the user, do I need to generate them through the REST API?
I'm currently trying the REST API but keep getting 401 error. I simply make a POST call with the following request object to the https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key={MyWebAPIKey}. And here's my request object:
{
"dynamicLinkInfo": {
"domainUriPrefix": "https://dl.mydomain.com/link",
"link": "https://dl.mydomain.com/link?id=12345",
"androidInfo": {
"androidPackageName": "com.my-domain.myapp"
},
"iosInfo": {
"iosBundleId": "com.my-domain.myapp"
}
}
My https://dl.mydomain.com is hosted by Firebase and is used only for dynamic linking purposes and when I go to the Dynamic Links console, it shows
https://dl.mydomain.com/link as my URL prefix.
So, I'm trying to understand:
If I'll simply add a user ID as a parameter, can I use the dynamic link I create through the console or do I need to generate a dynamic link programmatically -- in my case through the REST API?
If I need to do it through the REST API, what am I doing wrong in my code?
PS: Interestingly, when I try the POST call to Shortlinks API using Postman, it actually works and gives me a shortlink. When I try the same thing in my Expo app, I get a 401 error.

ServiceNow to Circuit Integration

Use Case scenario :
In case of Priority 1 incident in ServiceNow, we need to automate the system to start a conference meeting with pre-determined users in Circuit application.
REST API to create conversation is available but not to start conference.
We need to avoid manual intervention and to auto start the conference on creation of Priority 1 incident.
Queries :
1) Kindly advise if there is any way we can achieve this or circuit team will have some development plan to develop API to auto start conference.
2) If we use JS SDK, which have functionality available to create and start conference, so do we need to login every time while starting the conference from ServiceNow.
3) For JS SDK (implicit grant type), how authorization works for end user. How client id generated in circuit will be used for each end user. Can end user user their own circuit credentials to create and start conference.
4) When I use JS SDK to start conference, conference is getting started in my ServiceNow application then I need to pull request is Circuit application. Is there any way we can directly start conference in Circuit application.
There is an undocumented REST API (/remote/call/start) to start a call on the user's webclient or desktop client. Note that this API is undocumented which means there is no guaranteed backwards compatibility, but it will likely remain backwards compatible. The destClientId can be used to start the call on a specific device.
E.g. If the user has the desktop client and web client running you could specify which one. If not provided but the user is logged on to multiple devices, then a prompt will be shown to start the call. Use API /telephony/deviceInfos to get the destClientIds.
await this.axios.post('/remote/call/start',{
mediaType: 'audio', // audio, video or telephony
destClientId: ..., // optional. client id of user's device to start call on
emailAddress: ..., // email of user to call, only for direct call
phoneNumber: ..., // dialabe phone number
convId: ... // conversation ID, used for group calls
});
If the user still has a circuit session (30 days if the user uses Circuit clients with "private computer" checked) and the the access token is still valid according to TTL setting in application registration, then the JS SDK can logon without the user having to enter any credentials, or to accept permissions. logonCheck can be used to automatically login.
re what you question is here. For implicit, the clientId for the application is hardcoded in the application JS code. But since the client_id is restricted to be used on the registered domains, nobody else can use your client_id. The logon is shown the circuit-sdk github page:
const client = new Circuit.Client({
client_id: '<your client_id>',
domain: '<circuit domain> // e.g. circuitsandbox.net
});
const user = await client.logon();
Yes, use API startConference and pass the clientId (aka destClientId) of the client you wish to start the call at. Use getDevices to find the user's clientIds. This is the same as the REST API described in #1 above.

Google Cloud Functions is sending wrong Authentication values from app

I have a android app where i have updated the User Profile with new DisplayName but when calling a cloud function, the cloud function has wrong name.
Profile Update Code:
val profileUpdates = UserProfileChangeRequest.Builder()
.setDisplayName("Vinay")
.setPhotoUri(it)
.build()
FirebaseAuth.getInstance().currentUser!!.updateProfile(profileUpdates)
.addOnCompleteListener { task ->
if (task.isSuccessful) {
Log.d("post", "Updated Profile")
//Here Code Runs Successfully
// then call a cloud functio
}
}
but in cloud functions the userName: context.auth.token.name gives the actual provider displayname (VINNUSAURUS) and not the displayname I have changed before calling any cloud function.
context.auth.token contains information about the JWT used with Firebase Authentication, provided by the client. It's the same as what would be available in Firebase security rules. This doesn't contain the user's display name.
The display name is stored by Firebase Auth, and you can get it in a Cloud Function execution with the Firebase Admin SDK. First you will need the UID of the user making the request. The UID is available in context.auth.uid, but only for callable and Realtime Database type triggers. If you are writing some other kind of trigger, you will need to figure out some other way to get the UID.
The API call provided by the Admin SDK to get the display name is getUser(). It returns a UserRecord object with the display name. You can also read more about it in the documentation.

What is the default data source name to be passed to get the dec interaction?

I am creating a Dotnet application to pull out the customer data from the Sitefinity Digital Experience Cloud.
But when I am calling the Interaction API
https://api.dec.sitefinity.com/collect/v2/data-centers/{App KEY}/datasources/{datasourcesname}/interactions
When I had tried passing Website as the key it gives 1 as the response instead of the interactions data.
response data for the request
What will be the default dataSourceName need to be passed with the Sitefinity Digital Experience Cloud API to get the interaction details?
Page tracking code :
return DataIntelligenceSubmitScript.load({"apiServerUrl":"https://api.dec.sitefinity.com","apiKey":"88cf13bb-3424-12f4-6fc1-19360fexxxxx","applicationName":"Website","trackingCookieDomain":"","keepDecTrackingCookieOnTrackingConsentRejection":false});
You need to use one of the data sources configured under your data center.
Login into the DEC account -> Administration -> Click on the data center you want to use -> Data integration.
Articles that might help with the setup -
https://www.progress.com/documentation/sitefinity-cms/dec/plug-data-from-data-sources
https://knowledgebase.progress.com/articles/Article/how-to-configure-dec-in-sitefinity-cms