I'm trying serach in a drive for driveItems. I have figured out how to search for driveItems in the API like this:
https://graph.microsoft.com/v1.0/sites/{siteId}/drives/{driveId}/search(q='test')
But for my application, I need more detailed information about the documents so I tried to use the $expand without any successful outcome.
Request to look up more details about a single driveItem:
https://graph.microsoft.com/v1.0/sites/{siteID}/drives/{driveId}/items/{itemId}/listItem/?expand=fields($select=Title,ID,etc..)
Is it possible to achieve all the fields I get from this request when I use the $expand parameter in Search for DriveItems within a drive? Or do I need to look up every single driveItem to get the additional parameters?
What I have tried:
https://graph.microsoft.com/v1.0/sites/{siteId}/drives/{driveId}/search(q='test')?expand=fields($select=id,title,etc..)
According to my research and testing, unfortunately, when I use the following graph api:
https://graph.microsoft.com/v1.0/sites/{site-id}/drives/{drive-id}/items/{item-id}/?$expand=fields($select=id)
I got the error:
"message": "Parsing OData Select and Expand failed: Could not find a property named 'fields' on type 'microsoft.graph.driveItem'."
If you want to use the $expend parameter, I suggest you use the following Graph API:
https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items/{item-id}/?$expand=fields($select=id)
Related
I am triying to use SQLQueries using Service Layer JavaScript Extension to get some info from table OCRD (field DocEntry) beacuse is not expossed in stanard CRUD entities (BusinessPartners). Is there a way to do it? I can retrieve the information by Postman, but I am unable to do it using JavaScript.
Thank you
Unique key for Business Partners is CardCode, and this one is exposed with the BP object, of course.
DocEntry, which can be queried from OCRD using SQL, is not exposed within SL's BusinessPartner object.
In Working with SAP Business One Service Layer user manual - has this in it:
To run the query, there are two ways in the Service Layer: one is to set a payload using POST and the other is to
specify a query parameter using GET.
By POST
POST https://server:50000/b1s/v1/SQLQueries('sql01')/List HTTP/1.1
{
"ParamList": "docTotal=10.1"
}
By GET
GET https://server:50000/b1s/v1/SQLQueries('sql07')/List?docTotal=10.1 HTTP/1.1
I'm using the JIRA rest API in order to get the team of some user by passing their accountId as a parameter in the URL, for example:
URL = "https://my_account.atlassian.net/rest/api/3/user?accountId="+userId+"/team"
But I'm getting the error: "404 item not found".
Does anyone have any idea how I could get what I need?
I'm developing with Google App.Script, but the programming language does not matter if someone has some useful idea.
Thanks!
Firstly, you're forming the query incorrectly. You can't add parameters after the '?' using a forward slash because the forward slash is used for hierarchy in the URL.
Secondly, there is no endpoint 'team' and there currently is no mechanism provided by the Jira REST API to lookup what Team a user is a member of. Refer to this thread on the Atlassian community.
Have been looking for a way to programmatically update our agent's entity entries for a certain entity type through the DialogFlow API. The purpose is to automate the updating of our entity entries on a scheduled basis (as our entries will be changing daily).
Came across this documentation page by Google on batch updating entity entries but have not been able to get anything better than a 404 when testing.
Have tried sending POST's via Postman using the supplied path and inserting my project name in URL but I believe I may be making naive mistakes as I am new to this area (specifically REST-stuff)
Below is an example of the current 404 response & path used.
We are just looking to get past the 404 error, once we have the contact setup, should be able to figure out auth & the rest.
There are several things you need to take into account.
The URL should look like this:
https://dialogflow.googleapis.com/v2/projects/julia-development-2/agent/entityTypes/actual_id/entities:batchUpdate
the "parent" you used in the URL is just the name of the path param
make sure "julia-development-2" is the id of your GCP project and not just the name
(Hint: when you click the drop-down for selecting a certain GCP project in the google cloud console, both the name and the ID of the project will be visibile in the list)
replace "actual_id" with the entity type id
Related to auth:
you need a bearer token in the Authorization header
to get this token you first need to download a JSON key from your projects service account and set the GOOGLE_APPLICATION_CREDENTIALS environment variable to point to your JSON file. More details about setting up the service account and downloading the JSON key, you can find here: https://cloud.google.com/dialogflow/docs/setup
to get the token from the command line you can use
gcloud auth application-default print-access-token
I want to simulate a micro blogging application to learn Angular 2.
I am using the following json placeholder links:
users
post
As you can see, the post api has userId, (and not username). If I have to display the user name while listing all post, would I require another API with both post and user name, or can it be done using two different calls to the above APIs?
This is the way I will be listing the post :-
<li *ngFor="let post of posts">
<div>{{post.userId}}</div>
<div>{{post.id}}</div>
<div>{{post.title}}</div>
<div>{{post.body}}</div>
</li>
As you can see, here based on the api call, I am getting userId...Instead of that I want it to display user's name
The way to do this in angular is using services. You don't directly call to an API from within your component. You need to create a "service" to deal with APIs, then inject your service in your component and consume them in there.
In your particular scenario, you will have two services, a "UserService" and a "PostService". Each of those services have a proper "get" method that calls to an API. Then in your component, you inject both those services and call their respective methods separately.
Regarding your specific update on the question, imagine you have a "posts" array and a "users" array after you have received your result from the API. Now, pay attention to the following logic:
for (let i=0; i<posts.length; i++)
{
posts[i].username = users.filter(u => u.id === posts[i].userId)[0].username
}
What we did here is iterating through all "posts" and adding a "username" attribute to each of them by cross referencing them to the users array. Just make sure you use the right syntax and case sensitivity as I have not tested this line and just included the logic in it
Both the options are viable..
You can create another API that responds with the required data. The new API can cal the controller functions of the previous API endpoints and return the data in the required format.
note: this is possible if you are working with your own server.
you can also chain the API calls if you want to work with the existing APIs.. Call the user api and then when you get the user details, in the subscribe handler, make another request to the posts API.
note the only problem i can see with this approach is the number of requests.. as there will be a posts request for each user.
In the End the decision is yours. you'll have to see the pros and cons.. If the server code is also yours, ill suggest the first approach..
I want to display a low level treeview with all Sub-Accounts of an Account. But I'm not able to retrieve all related Sub-Accounts trough oData of a specific Account.
I tried some suggestions with the OData Query Designer but I always get the message "NotFound". My current query is
http://localdev:5555/DynamicsCRM2011/xrmservices/2011/OrganizationData.svc/AccountSet(guid'19F4DA91-B0FD-E111-BAA8-00155D03A50D')/account_parent_account
The Relationship is 1:N.
Are there any Suggestion how to solve this?
For get related records you have to use $expand, like that:
/AccountSet?$expand=opportunity_customer_accounts
See more examples here.