Create inactive account - dynamics-crm

I want to synchronize with another system, accounts, and if the entity is inactive in that system, I want to create the account with inactive status. something very simple like:
{
"accountnumber": "InactiveAcct",
"name": "Account that should be created as inactive",
"description": "demo",
"statecode": 1,
"statuscode": 2
}
I'm doing a POST request but as a reply I get:
{
"error": {
"code": "0x80048408",
"message": "2 is not a valid status code for state code AccountState.Active on account with Id e2d0f844-313e-eb11-a813-000d3a795762."
}
}

Unfortunately you cannot create (POST) an inactive record, you have to create it first and then make an update (PATCH) call to mark inactive. This is by design and it’s a limitation. Read more
statecode field is not available for create. Record will be always created as active. The only way for you is to do 2 steps operation - create and set as inactive after.
In other words, statecode=0 is set as default by system, when you pass statuscode=2 in create payload - the platform validation kicks in and say this is invalid pair.

Related

How mention a group of teams in a flow of power automate?

I create a group for question in Microsoft teams, the name for this group is "Information Comunity". In this group, I put a Microsoft forms to capture the question.
Then, I create a Flow with Microsoft power Automate. This flow send send a message in "information Comunity" group, like this
I need to mention a other group in this message, the name of the other group is "Gerencia de information", this group will answer the question. But I don´t know how to capture the name of thisgroup or how i get the id of the other group.
Can you help me please.
Thanks for your help.
1 The Flow will use a manual trigger.
2.After that the Flow initializes three variables as below:
3.First make sure that you invoke the HTTP request action connection using https://graph.microsoft.com as the Base Resource URL and Azure AD Resource URI values like in the screenshot below:
4.Then invoke the HTTP request
Body of the request:
{
"body": {
"content": "This is Flow mention channel test, <at id=\"0\">RA Experts</at>",
"contentType": "html"
},
"mentions": [
{
"id": 0,
"mentionText": "RA Experts",
"mentioned": {
"conversation": {
"id": "19:ac7b9c53a099498f9e08679e58f1f7fc#thread.tacv2",
"displayName": "RA Experts",
"conversationIdentityType": "channel"
}
}
}
]
}
Result:

how to Detect Marketing and Role based emails programmatically?

I have requirements where I would have to distinguish emails whether it is regular email, Marketing email, or Role based email.
Marketing Emails: Emails that correspond to a marketing campaign. Typically sent to a batch of users and composed with tools like
MailChimp, etc...
Role-Based Emails: Emails addresses that are not associated with a particular person, but rather with a company, department, position, or
group of recipients (ex: noreply#, marketing#, support#, etc).
Can I identify this by email header information? Or is there any other way to achieve this?
Technology using:
Gmail API: to get email information
Spring boot: to process emails
By using the Gmail API you can retrieve the emails by using the following request:
GET https://gmail.googleapis.com/gmail/v1/users/{userId}/messages/{id}
Which will end up returning the body of a Message with the following similar structure:
{
"id": ID,
"threadId": THREAD_ID,
"labelIds": [
"CATEGORY_PROMOTIONS",
"UNREAD",
"INBOX"
],
"payload": {
"headers": [{
"name": "Reply-To",
"value": "NAME \u003cnewsletter#email.com\u003e"
},
{
"name": "Subject",
"value": "Week 9 Newsletter"
},
{
"name": "From",
"value": "NAME \u003csupport#email.com\u003e"
},
"body": {
"size": SIZE,
"data": ""
}
},
}
So depending on how you want to process these afterwards, you can use some of the following fields from the returned email:
labelIds - this field will contain all the labels attached to the incoming email which means that (depending on the settings you have for your inbox) you can easily check this email for instance as being a promotional email because of the CATEGORY_PROMOTIONS label attached to it;
Reply-To header - you can retrieve the email address here and later analyze it;
Subject header - assuming you have a list of keywords set up, you can search the subject of the email and later mark it based on the results;
From header - you can retrieve this email address here and again, based on a list of keywords, you can decided of which type this email is.
Reference
Gmail API Message Resource.

How can I disable waiting room in Google Meets created with calendar api?

In the Google Calendar api there's the ability to request that a conferencing link be created when an event is created.
My current setup is that I have an account that is creating google calendar events whenever someone schedules a meeting on my app. The problem is that when someone outside of my organization tries to join the meeting it says "ask to join" which isn't possible since nobody from my organization will be in the meeing. Are there are parameters to let me turn off the waiting room feature or at least have a list of approved emails that are allowed to enter the meeting. The request body looks like this right now:
{
"end": {
"dateTime": "2020-08-30T05:27:35.206Z"
},
"start": {
"dateTime": "2020-08-29T05:27:35.206Z"
},
"conferenceData": {
"createRequest": {
"conferenceSolutionKey": {
"type": "hangoutsMeet"
},
"requestId": "12345"
}
},
"summary": "Test event with meets 2",
"attendees": [
{
"email": "****#gmail.com"
}
]
}
The attendee I added still has to request to join the meeting.
This appears to be a bug!
I have taken the liberty of reporting this on Google's Issue Tracker for you, detailing the behaviour:
User from outside of G Suite domain required to ask to join a Meeting from a Calendar event they are invited to
You can hit the ☆ next to the issue number in the top left on the page which lets Google know more people are encountering this and so it is more likely to be seen to faster.

Apache NiFi Create Process Group with my own ID

Background
According to the NiFi API documentation, id is an optional field on a create process group request:
POST /process-groups/{id}/process-groups
{
"revision": {
"version" : 0
},
"id" : "8a698dd8-7947-43fd-8bdd-2d4f26ee3329",
"component": {
"name": "my-process-group-foo"
}
}
This will create a new process group as a child of the {id} process group. I would assume that by passing in a GUID as part of the request body, the resulting process group would be created using the GUID that I passed in.
Through testing though I've come to realize that the process group that is created is assigned an id by NiFi and does not use the id that I've passed in.
Response from above example (condensed)
{
"revision": {
"version": 1,
},
"id": "7d47183d-0173-1000-ffff-fffff6dceb50",
"component": {
"id": "7d47183d-0173-1000-ffff-fffff6dceb50",
"parentGroupId": "348a629f-0173-1000-a243-b2203c5b8272",
"name": "my-process-group-foo"
}
}
Instead of creating my process group with the id I asked for it assigned a completely new id.
If I try add my id inside of the component object I get a 400 error Process group ID cannot be specified.
Question
Is there a way to create a process group using an id that I specify?
I am currently trying to figure out how to update versioned processes from NiFi Registry when I have the same process running on multiple clusters (different data centers). My original thought was if I could create the process group with the same id on all of the clusters, I could then have my CI/CD pipeline create a version update request, confident that the same id is on all the clusters.
References
https://nifi.apache.org/docs/nifi-docs/rest-api/index.html
The short answer is no you cannot specify the UUID, it will always be assigned by NiFi. I believe the field is marked as optional because you can supply it without generating an error, but it will be ignored - Such as as when you upload templates or other flow definitions.

Is botId that bot scoped? Is it permanent?

Is the botId that I receive in the webhook only bot scope or is it unique across all the bots found?
Is it permanent or can it be changed?
By botId I mean the id in recipient.id and replyToId that you fill in send message request to endpoint https://smba.trafficmanager.net/apis/v3/conversations/{{skype.idRecipient}}/activities:
{
"text": "God help us!",
"type": "message",
"from": {
"id": "{{skype.idBot}}",
"name": "bot"
},
"recipient": {
"id": "{{skype.idRecipient}}",
"name": "user"
},
"replyToId": "{{skype.idBot}}"
}
The ID you are talking about is unique only in the current channel (Skype/Facebook/Slack...) as it is the ID of ChannelAccount.
Here are some statements from documentation:
Every bot and user has an account within each channel. The account
contains an identifier (id) and other informative bot non-structural
data, like an optional name.
Also
Channel accounts have meaning only within their associated channel
So it's not excluded that id may be repeated on another channels.
And what about permanency, it depends on the channel you use as stated in documentation again:
The stability of associations between IDs, accounts, mailboxes, and
people depends on the channel
But if you want it to be "unique across all the bots found" then you can create an id by combining AppID, ChannelID and User ID.
Also here is a quite informative guide about IDs in Bot Framework which may be helpful to you

Resources