Send an HTTP request to SharePoint with GET Method and GetByTitle URI - power-automate

I am trying to build an approval flow in Power Automate following the walk-through https://kamdaryash.wordpress.com/2020/04/
My target folder on the SharePoint is located in a folder (Shared Documents/MyFolder)
one step 4 (Send an HTTP request to SharePoint), I have the following:
- Site Address: approvals - https://something.sharepoint.com/sites/SOPapprovals
- Method: GET
- Uri: _api/Web/Lists/GetByTitle(‘Shared%20Documents/MyFolder’)/Items?$select=EncodedAbsUrl,FileLeafRef,ID&$Filter=Id eq ItemId
- Header: { "Accept": "application/json;odata=nometadata"}
Only problem is that I am always getting the following error message
<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<m:code>
-1, Microsoft.SharePoint.Client.InvalidClientQueryException
</m:code>
<m:message xml:lang="en-US">
The expression "Web/Lists/GetByTitle(‘Shared Documents/0. Submitted For Approval’)/Items" is not valid.
</m:message>
</m:error>
Does anyone have an idea where the problem is coming from ?
Thanks

/_api/Web/Lists/GetByTitle('SubmitForApproval')/Items

Related

slash command "dispatch_failed"

I have went through creating the custom slash command configuration via slack and installed it on workspace. However when I run it I get this
/testing failed with the error "dispatch_failed"
I tried multiple workspaces but same issue. Anyone experienced this?
So after a few tests, I found out that this is just a generic message of anything that fails at slack at this point. I have first my endpoint that was unreachable. So it was returning this message. I fixed that, used ngrok for tunnel so that I could debug and that is how I found this issue.
Also, this error can occur due to the following reasons as well.
Errors in code
Unreachable backend or Invalidly configured slash command in the app
While the documentation tells you:
"use the Request URL is your base server link + "/slashcommand" after it"
This is incorrect. The request URL should be: "/slack/events"
Of course the command needs to match whats in the 'edit command' window and in the method '.command' in your app.js:
app.command('/flash-card', async ({ ack, body, client })
If you're using ngrok http <port> to test in your localhost, be aware that a new ngrok public URL is created every time you run this command. So in https://api.slack.com/apps, in your app's Features, you may have to update your Slash Command' request URL with the current ngrok URL generated for you.
You need to set the Method in the Integration Settings to GET, is default to POST
This is also the error for a 404 Not Found.
If you're developing offline with ngrok, the 404 error can be seen in the terminal.
If you're deploying with serverless, ensure that you're handling the new endpoint /slack/command. One solution is to create a separate handler, i.e. /command.js
functions:
slack:
handler: app.handler
events:
- http:
path: slack/events
method: post
command:
handler: command.handler
events:
- http:
path: slack/command
method: post
[If your code is executing and u still have this error]
In my case using Slackbolt with js I forgot to add
await ack();
in called function so Slack api throw error.

why aspnetboilerplate create method in RoleAppService not getting call?

i downloaded aspnetboilerplate template from it sites and trying to work with it, template works fine when it is in development environment but when change the environment from to development to production ,role create method in RoleAppService not calling from ui but the other application service which is userappservice getting call from ui and working correctly.
things I've changed are :
1.change db to mysql so that i had to regenerate migration
2.change port in program.cs to 5050
public static IWebHost BuildWebHost(string[] args)
{
return WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.UseUrls("http://localhost:5050/")
.Build();
}
here is my Log.txt section that i think is important
soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:5000/view-resources/Views/Roles/Index.min.js
soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 21.0463ms 404
soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 POST http://localhost:5000/signalr/negotiate text/plain;charset=UTF-8 0
soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 17.9473ms 200 application/json
soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:5000/signalr?id=QSajncgdfPs_oDA5mHNy3g
.AspNetCore.SignalR.HubConnectionContext - Completed connection handshake. Using HubProtocol 'json'.
Abp.AspNetCore.SignalR.Hubs.AbpCommonHub - A client is connected: {"ConnectionId":"QSajncgdfPs_oDA5mHNy3g","IpAddress":"::1","TenantId":1,"UserId":2,"ConnectTime":"1398-07-01T12:59:23.3138178+03:30","Properties":{}}
Abp.AspNetCore.SignalR.Hubs.AbpCommonHub - A client is registered: QSajncgdfPs_oDA5mHNy3g
soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:5000/Roles?Name=test4&DisplayName=test4&Description=test4&permission=Pages.Users&permission=Pages.Roles
ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "Index", controller = "Roles", area = ""}. Executing action binabtc.Web.Controllers.RolesController.Index (binabtc.Web.Mvc)
I double-check everything again this problem happens when switching environment to production for kestrel, as it is appear in log it could not find view-resources/Views/Roles/Index.min.js and the postback can`t get the app service url from it which is /api/services/app/Role/Create , it is weird because user appservice works fine in this situation.
for anyone like me, i the problem
i didn't installed the Bundler & Minifier and view-resources/Views/Roles/Index.min.js wasn't there by default after installing the extension and minify Roles/Index.js everything worked fine

Jmeter file upload using PUT not working

I am trying to upload a file using the PUT method, which is not including the file in the request. I have followed the other example POST methods, but considering PUT does not allow multipart to be checked, that might be the issue.
I am also using:
* httpClient4
* jmeter 3.3
screenshot : https://www.evernote.com/shard/s126/sh/b4ebf947-c7e4-4e0a-9ebf-8e42a5f5d082/6813671cb2ab7419
Request data:
PUT http://myurl----here/app_path/test__16525587b4361f339ca33a9cdf0e9201d90e76dc__1676871c-71b8-488a-9750-29554a4be722
PUT data:
[no cookies]
Request Headers:
Connection: close
Content-Type: application/octet-stream
Content-Length: 0
Host: int-cloudstore-perf.svc.netspot.com.au
User-Agent: Apache-HttpClient/4.5.3 (Java/9.0.1)
Your test does't seem to be sending anything as your Put data should not be blank.
I would recommend to remove data from the Parameter Name section of the "Files Upload" tab of the HTTP Request sampler as PUT method is different and it doesn't assume submitting an HTML form and most probably your request will start working as expected (at least it will send data to the server)
Just in case check out Testing REST API File Uploads in JMeter article

%2F is not working for "/" but %3F is working for "?" in Web API uri

I am using custom function in Restful API to get the specific result.
to get the string with name "ABC?" i am sending below GET request URI
https://localhost:44372/route/V1/Values/ExistsValue(Name='ABC%3F')/
this is working fine. but to get the name as "ABC/" i am sending below GET request URI
https://localhost:44372/route/V1/Values/ExistsValue(Name='ABC%2F')/
but this doesn't work. it showing error like below
IIS 10.0 Detailed Error - 404.0 - Not Found
How to handle this?
Thanks in advance....

Warning status issue in jmeter result table

I have to do load testing for a web based application. I am getting status as warning the results table. My request contains the URL and the path as /. I have passed username and password in the parameters section. Even after tried many times still it shows status as warning.
I have also tried using Proxyserver address, port, user name and password ...still no luck..
Please help me on this.
If you get a Warning status, this means that JMeter detected a response code > 399.
There can be a lot of reasons for this, examples:
Wrong URL : 404
Error : 500
To have more details on it, add a View Results Tree and inspect all tabs to see:
Request : What you are sending (headers / Cookies / body)
Response : What you are getting (headers / Cookies / body)
Then fix your HTTP request by comparing request in browser with what you have build.
Alternatively, use JMeter recording feature.
To see all ways to debug a script, have a look at this book where sample chapter explains lot of ways.
If you get warning status that means your entered URL contains https:// part which means your given URL working with HTTP protocol.
Remove https:// part from
- HTTP Request Defaults
- HTTP Request
So replace https:// part by WWW and try again

Resources