web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Send an HTTP request t...
Power Automate
Unanswered

Send an HTTP request to SharePoint for link with 401 Unauthorized

(0) ShareShare
ReportReport
Posted on by 115

splink1.png

splink2.png

I am not sure if the above update for SharePoint link with alternative text (Description) above is correct or not. Anyway, it got the 401 unauthorized error. How to solve this problem?

Categories:
I have the same question (0)
  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at

    @nahcyrret Pls share full content of http body. Also share column name from SharePoint List. if possible share screens.

    Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

    @Hardesh /Gopenly.in

  • nahcyrret Profile Picture
    115 on at

    INPUTS

    {
    "_metadata": {
    "type": "SP.Data.Incidents.ListItem"
    },
    "Link": {
    "Description": "INC251499",
    "Url": "https://.../nav_to.do?uri=incident.do%3Fsys_id=ca153756db0d1190e504df0bd396197c%26sysparm_stack=incident_list.do%3Fsysparm_query=active=true"
    }
    }

    OUTPUTS

    {
      "status"401,
      "message""401 UNAUTHORIZED\r\nclientRequestId: 6ea9a978-7ab0-45ab-9cdd-280216f354d6\r\nserviceRequestId: e59357a0-00b0-1000-72b9-e3fd253e1a90",
      "source""https://.../sites/ITS-UserServices/api/lists/getbytitle(%E2%80%98Incidents%E2%80%99)/items(32)",
      "errors": []
    }
    Link.PNGA

    I just want to write the Link field with alternative text with the Description above. Is it correct? Also, I am the owner of the site with the Incidents list. The flow runs under my account in power automate.

  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at

    @nahcyrret Check these two-

    1. "source""https://.../sites/ITS-UserServices/api/lists/getbytitle(%E2%80%98Incidents%E2%80%99)/items(32)",

    quote around Incident?

    2. "Url": "https://.../nav_to.do?uri=incident.do%3Fsys_id=ca153756db0d1190e504df0bd396197c%26sysparm_stack=incident_list.do%3Fsysparm_query=active=true"

    Are you able to access URL?

    Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

    @Hardesh /Gopenly.in

  • nahcyrret Profile Picture
    115 on at

    1. The SharePoint list name is Incidents.

    2. I am able to access the URL.

  • Verified answer
    Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at

    @nahcyrret see quote around Incident. Have you copy paste from notepad/word? 

    Hardesh15_0-1659595575054.png

    See the difference-

    Hardesh15_1-1659595633326.png

    Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

    @Hardesh /Gopenly.in

     

  • nahcyrret Profile Picture
    115 on at

    httprequest.png

    Is there anything wrong? Do I need to remove the quote around Incidents?

  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at

    @nahcyrret  Pls test your flow.

    Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

    @Hardesh /Gopenly.in

  • nahcyrret Profile Picture
    115 on at

    INPUTS

    {
    "_metadata": {
    "type": "SP.Data.Incidents.ListItem"
    },
    "Link": {
    "Description": "INC251309",
    "Url": "https://.../nav_to.do?uri=incident.do%3Fsys_id=11151b71db499d50446c2e1fd396195c%26sysparm_stack=incident_list.do%3Fsysparm_query=active=true"
    }
    }

    OUTPUTS

    {
      "status"400,
      "message""The property '_metadata' does not exist on type 'SP.Data.IncidentsListItem'. Make sure to only use property names that are defined by the type.\r\nclientRequestId: 70db870d-046a-4c6d-b72c-3145abe9185b\r\nserviceRequestId: 4ee757a0-603f-1000-72b9-e1ecaf12a6c6",
      "source""https://.../sites/ITS-UserServices/_api/lists/getbytitle('Incidents')/items(38)",
      "errors": [
        "-1",
        "Microsoft.SharePoint.Client.InvalidClientQueryException"
      ]
    }
     
    Now, the error changed as above.
  • Verified answer
    Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at

    @nahcyrret Your _metadata tag is incorrect. it should be __metadata (here two underscore)

    Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

    @Hardesh /Gopenly.in

     

     

  • nahcyrret Profile Picture
    115 on at
    {
      "status"400,
      "message""{\"odata.error\":{\"code\":\"-1, Microsoft.SharePoint.Client.InvalidClientQueryException\",\"message\":{\"lang\":\"en-US\",\"value\":\"A type named 'SP.Data.Incidents.ListItem' could not be resolved by the model. When a model is available, each type name must resolve to a valid type.\"}}}\r\nclientRequestId: 48a64a77-c955-4d50-b606-04fa46bed8a8\r\nserviceRequestId: 35f157a0-e0ac-1000-752f-b56a3be9dfda",
      "source""https://.../sites/ITS-UserServices/_api/lists/getbytitle('Incidents')/items(42)",
      "errors": []
    }
     
    The above error occurred after changing to __metadata.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard