Skip to main content

Notifications

Power Automate - General Discussion
Answered

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?

  • nahcyrret Profile Picture
    nahcyrret 115 on at
    Re: Send an HTTP request to SharePoint for link with 401 Unauthorized

    httprequest.png

    Finally, I got it right as above.

  • nahcyrret Profile Picture
    nahcyrret 115 on at
    Re: Send an HTTP request to SharePoint for link with 401 Unauthorized
    {
      "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.
  • Verified answer
    Hardesh15 Profile Picture
    Hardesh15 7,087 on at
    Re: Send an HTTP request to SharePoint for link with 401 Unauthorized

    @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
    nahcyrret 115 on at
    Re: Send an HTTP request to SharePoint for link with 401 Unauthorized

    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.
  • Hardesh15 Profile Picture
    Hardesh15 7,087 on at
    Re: Send an HTTP request to SharePoint for link with 401 Unauthorized

    @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
    nahcyrret 115 on at
    Re: Send an HTTP request to SharePoint for link with 401 Unauthorized

    httprequest.png

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

  • Verified answer
    Hardesh15 Profile Picture
    Hardesh15 7,087 on at
    Re: Send an HTTP request to SharePoint for link with 401 Unauthorized

    @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
    nahcyrret 115 on at
    Re: Send an HTTP request to SharePoint for link with 401 Unauthorized

    1. The SharePoint list name is Incidents.

    2. I am able to access the URL.

  • Hardesh15 Profile Picture
    Hardesh15 7,087 on at
    Re: Send an HTTP request to SharePoint for link with 401 Unauthorized

    @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
    nahcyrret 115 on at
    Re: Send an HTTP request to SharePoint for link with 401 Unauthorized

    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.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,636

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,942

Leaderboard