3

We are trying to access SharePoint REST APIs, each call to them returns with 404 NOT Found error. We tried to check https://sitename/_api/contextInfo, there was again 404 error in response.

We are trying to access this API from an IOS app. Tried the same from POSTMAN to confirm the same.

Kindly advice.

4
  • Which HTTP method u are using? You need to use HTTP POST May 6, 2016 at 10:57
  • POST Method @AtishDipongkor
    – ios dev
    May 6, 2016 at 11:19
  • Just to be sure, is this SP 2013? 2010 has a different REST syntax. May 6, 2016 at 15:13
  • 1
    its 2010. Could you please let me know the syntax.
    – ios dev
    May 9, 2016 at 6:09

1 Answer 1

2

The correct one is https://sitename/_api/web. If you type this URL in a browser like Chrome, it should display the current site information in XML.

Also check your protocol, it might be https instead of http.

If you still get the error than you need to download the SP 2013 Client Components SDK & brought up PowerShell V3

Use below mentioned code in PowerShell V3

# Invoke-RestSPO -Url "https://XXXXXXXX.sharepoint.com/_api/web"

Above code came from below mentioned code

<#
.Synopsis
    Sends an HTTP or HTTPS request to a SharePoint Online REST-compliant web service.
.DESCRIPTION
    This function sends an HTTP or HTTPS request to a Representational State
    Transfer (REST)-compliant ("RESTful") SharePoint Online web service.
.EXAMPLE
   Invoke-SPORestMethod -Url "https://contoso.sharepoint.com/_api/web"
.EXAMPLE
   Invoke-SPORestMethod -Url "https://contoso.sharepoint.com/_api/contextinfo" -Method "Post"
#>
1
  • 2
    We tried using this but still it gives 404 not found. I tried in browser and POSTMAN also.
    – ios dev
    May 6, 2016 at 11:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.