What is the EntityLogicalName for activities in Microsoft Dynamics CRM - node.js

I've been able to successfully fetch items like leads, opportunities, and contacts from the dynamics API, but I've been unable to figure out how to fetch any kind of activity objects. I'm making a request that looks like this:
POST http://myAddress/myDomain/RetrieveMultiple
**headers**
Content-Type: application/json
User-Agent: our user agent
**json**
{
"Credential": {
"Domain": "thedomain",
"UserId": "theuserid",
"Password": "thepass",
"Version": "2016",
"ConnectionType": "1"
},
"EntityLogicalName": "contact",
"DateCriteria": "2000-01-01T00:00:00Z",
"DateFilterName": "modifiedon",
"Operator": ">=",
"Order": "asc",
"MaxItems": 100,
"pageNumber": 1
}
When I change the EntityLogicalName to "activitypointer", "task", "appointment", and anything else I can think of I get back an error that says "Invalid Entity name"

Activities is an abstract entity, therefore you'll need to query the concrete ones like:
"email", "phonecall", "task", etc...

Related

How to get the user information using the user lookup ID from fields property when accessing items from a share-point list using Ms Graph API

I am accessing a Share-point list using the MS graph API endpoint:
https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?expand=fields
I am getting the list items just fine, but I also want to get the user information attached in each field. The data item returned looks like this:
{
...other properties,
"fields": {
"#odata.etag": "\"eTag,1\"",
"id": "1",
"ContentType": "Item",
"Title": "<Some Title>",
"Modified": "<modified dateTime>",
"Created": "<created dateTime>",
"AuthorLookupId": "12",
"EditorLookupId": "12",
"_UIVersionString": "1.0",
"Attachments": false,
"Edit": "",
"LinkTitleNoMenu": "<num>",
"LinkTitle": "<num>",
"ItemChildCount": "0",
"FolderChildCount": "0",
"_ComplianceFlags": "",
"_ComplianceTag": "",
"_ComplianceTagWrittenTime": "",
"_ComplianceTagUserId": "",
"Status_Name": "<status_name>",
"Title0": "<some_title>",
"Dept": "Dept A",
"Emp_LeadLookupId": "200", //This is the user whose details I need(email-id)
"Quality_Approver": "<some_user>"
}
}
How do I get the user's details as well and not just a LookupId, OR how can I use the look up ID to get the said user's information?
I searched above and beyond but didn't find anything relevant. Any help is greatly appreciated!
Currently Microsoft Graph is not support the function of finding users through the lookup column.

How to build a more complex query to get a Rresponse from different URLs in Microsoft Graph explorer in a single request

I want to get the Name, ID, Name of the assigned Role and the ID of the role of one user in one single request.
To get all the Roles assigned to one user I used this Query:
GET https://graph.microsoft.com/v1.0/rolemanagement/directory/roleAssignments?$filter=principalId eq '55c07278-7109-4a46-ae60-4b644bc83a31'
https://learn.microsoft.com/en-us/azure/active-directory/roles/list-role-assignments-users
The problem with this query is, that it will return the roleDefinitionId (ID of the Role) but it wont return the name of the Role. I could get the name with the next query down below but then it shows me all of the possible roles and not the roles of the specific user.
https://graph.microsoft.com/v1.0/directoryRoles
https://learn.microsoft.com/en-us/graph/api/directoryrole-list?view=graph-rest-1.0&tabs=http
So as I see it I need to combine 3 queries into one to get all the information I need. The Response should look something like this:
"body": {
"value": [
{
"id": "RhIJaeggVsdfglgdbKnqH7iZeBasdGEush5pky7SmE-1",
"principalId": "55c07278-7109-4a46-ae60-4b644bc83a31",
"userDisplayName": "Ben Dover"
"roleDisplayName": "Global Administrator",
"roleDefinitionId": "69091246-20e8-4a56-aa4d-066075b2a7a8"
}
}
To achieve that I tried this:
POST https://graph.microsoft.com/v1.0/$batch
{
"requests": [
{
"id": "1",
"method": "GET",
"url": "directoryRoles/0f564192-5db7-4c5e-a9bc-8d5sdgfaf7af/members"
},
{
"id": "2",
"method": "GET",
"url": "rolemanagement/directory/roleAssignments?$filter=principalId eq 'e065e27e-b675-443c-bac8-79a453bb4a61'"
},
{
"id": "3",
"method": "GET",
"url": "me/?$select=displayName,id"
}
]}
Now this works. And I get all the Information that I need, but the response is pretty long and hard to read even if you know what you are looking for. Is it possible to get the response in a shortened form like in the example above?

MS teams adaptive card not sending input text value on submit

I am 500% sure it used to work and all of a sudden this is broken. The card for getting input is no longer passing the value back to nodejs.
The card looks like below:
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "Note text"
},
{
"type": "Input.Text",
"placeholder": "Type a note",
"isMultiline": true,
"id": "noteIdVal"
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Save",
"data": { "action" : "add_note", "objNumber": objId, "objType": objectType }
},
{
"type": "Action.Submit",
"title": "Cancel",
"data" : {"action": "cancel"}
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}
On the submit action, in my nodejs i am getting the data in the values node which are passed in the data field. However, it is no longer attaching noteIdVal. Did something changed from MS side?
MS Teams Adaptive card required special property with the name msteams to the object in an object submit action’s data property in order to access this functionality.
{
"type": "Action.Submit",
"title": "Click me for messageBack",
"data": {
"msteams": {
"type": "messageBack",
"displayText": "I clicked this button",
"text": "text to bots",
"value": "{\"bfKey\": \"bfVal\", \"conflictKey\": \"from value\"}"
},
"extraData": {}
}
}
The type property is "messageBack" the submit action will behave like a messageBack card action, which is like a combination of imBack and postBack.
Reference :
Microsoft Docs for MS Teams Adaptive Card
So, may be useful to other folks here. I have two showCards and the content of both the show cards has a common text field with same id name "noteIdVal". As ultimately it is a single json and hence was the culprit.
Lesson, have all fields unique id values which is easy to miss when you have multiple show cards

how to implement algolia autocomplete on a single index, but i want results to show based on facets

I have an index on algolia, each document like this.
{
"title": "sample title",
"slug": "sample slug",
"content": "Head towards Rajinder Da Dhaba for some insanely delicious Kebabs!!",
"Tags": ["fashion", "shoes"],
"created": "2017-03-30T12:10:08.815Z",
"city": "delhi",
"user": {
"_id": "58b6f3ea884fdc682a820dad",
"description": "Roughly, somewhere between insanity and zen. Mostly the guy at the window seat!",
"displayName": "Jon Doe"
},
"type": "Post",
"places": [
{
"name": "Rajinder Da Dhaba",
"slug": "Rajinder-Da-Dhaba-safdarjung-9e9ffe",
"location": {
"_geoloc": [
{
"name": "Safdarjung",
"_id": "59611a2c2094b56a39afcbce",
"coordinates": {
"lng": 77.2030268,
"lat": 28.5685586
}
}
]
}
}
],
"objectID": "58dcf5a0355b590560d6ad68",
}
I want to implement autocomplete on this.
However, when i see the demos present in algolia dashboard, i found out that it returns the complete documents.
I want to only match on user.displayName, place.name, and title
and return only these fields as suggestions in the autocomplete results instead of complete documents, which match.
I know I can create separate indexes for users, places;
But is this possible with only a single index??
Did you had a look at http://algolia.com/doc/tutorials/search-ui/autocomplete/auto-complete/ ?
It shows how to have a custom display from an index.
To match on on user.displayName, place.name, and title
you can configure the "searchable attributes" from the algolia dashboard.

List of Envelope Documents request does not return envelopeDocuments

I'm having an issue with the following request:
/accounts/{accountId}/envelopes/{envelopeId}/documents
Request:
GET https://na2.docusign.net/restapi/v2/accounts/ACCT_ID/envelopes/ENVELOPE-GUID/documents
And the response looks like this:
{
"envelopeId": "ENVELOPE-GUID"
}
That's the full response I get. It does reproduce at least for several envelopes for me. The envelopes in question are all in 'Completed' or 'Awaiting my signature' sate and have been sent from other DocuSign accounts.
If requested using the sender account, I get a normal response containing the envelopeDocuments array. Same goes for other recipients accounts present in the envelope. The request for those accounts however uses **www.**docusign.net as the baseUrl based on the login_information response.
This also reproduces if I send from the na2 account and later try to retrieve documents list from the www ones so I would say it's some kind of sharding issue.
The request used to work fine with the same accounts earlier.
This is a bug and I've filled it as such with DocuSign's support department.
Authenticating as the sender will be the only workaround you could do for now.
Here's the actual issue:
Create envelope on NA2 and send it to an active account on NA1
Run the following call against REST (v2 or vdev, same results) with the Signer's account information
GET:https://www.docusign.net/restapi/v2/accounts/{accountId}/envelopes/{envelopeId}/documents
Actual Results:
{
envelopeId: "EnvelopeIdGUID"
}
Desired Results:
{
"envelopeId": "EnvelopeIdGUID",
"envelopeDocuments": [
{
"documentId": "1",
"name": "Document1.pdf",
"type": "content",
"uri": "/envelopes/{EnvelopeId}/documents/1",
"order": "1",
"pages": "1"
},
{
"documentId": "2",
"name": "Document2.pdf",
"type": "content",
"uri": "/envelopes/{EnvelopeId}/documents/2",
"order": "2",
"pages": "1"
},
{
"documentId": "certificate",
"name": "Summary",
"type": "summary",
"uri": "/envelopes/{EnvelopeId}/documents/certificate",
"order": "999",
"pages": "4"
}
]
}

Resources