Skip to main content
deleted 10 characters in body
Source Link
Mike
  • 12.2k
  • 8
  • 43
  • 64

I'm trying to get file by using GetFileByServerRelativeUrl and getting the url length restriction error. In some posts I see that people reccomendrecommend to use this call with parameter , like this :

https://tenant-my.sharepoint.com/personal/user_account_tenant_onmicrosoft_com/_api/web/getfilebyserverrelativeurl(@v)/$value?@v='....' 

But when I'm doing this I'm getting next error :

400 : {"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The query string "serverRelativeUrl" is missing or invalid."}}}

What I'm doing wrong ? I'm doing HTTP GET from Java code.

Thanks

I'm trying to get file by using GetFileByServerRelativeUrl and getting the url length restriction error. In some posts I see that people reccomend to use this call with parameter , like this :

https://tenant-my.sharepoint.com/personal/user_account_tenant_onmicrosoft_com/_api/web/getfilebyserverrelativeurl(@v)/$value?@v='....' 

But when I'm doing this I'm getting next error :

400 : {"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The query string "serverRelativeUrl" is missing or invalid."}}}

What I'm doing wrong ? I'm doing HTTP GET from Java code.

Thanks

I'm trying to get file by using GetFileByServerRelativeUrl and getting the url length restriction error. In some posts I see that people recommend to use this call with parameter , like this :

https://tenant-my.sharepoint.com/personal/user_account_tenant_onmicrosoft_com/_api/web/getfilebyserverrelativeurl(@v)/$value?@v='....' 

But when I'm doing this I'm getting next error :

400 : {"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The query string "serverRelativeUrl" is missing or invalid."}}}

What I'm doing wrong ? I'm doing HTTP GET from Java code.

added 10 characters in body
Source Link

I'm trying to get file by using GetFileByServerRelativeUrl and getting the url length restriction error. In some posts I see that people reccomend to use this call with parameter , like this :

https://tenant-my.sharepoint.com/personal/user_account_tenant_onmicrosoft_com/_api/web/getfilebyserverrelativeurl(@v)/$value?@v='....' 

But when I'm doing this I'm getting next error : 400 : {"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The query string "serverRelativeUrl" is missing or invalid."}}}

400 : {"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The query string "serverRelativeUrl" is missing or invalid."}}}

What I'm doing wrong ? I'm doing HTTP GET from Java code.

Thanks

I'm trying to get file by using GetFileByServerRelativeUrl and getting the url length restriction error. In some posts I see that people reccomend to use this call with parameter , like this :

https://tenant-my.sharepoint.com/personal/user_account_tenant_onmicrosoft_com/_api/web/getfilebyserverrelativeurl(@v)/$value?@v='....' 

But when I'm doing this I'm getting next error : 400 : {"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The query string "serverRelativeUrl" is missing or invalid."}}}

What I'm doing wrong ? I'm doing HTTP GET from Java code.

Thanks

I'm trying to get file by using GetFileByServerRelativeUrl and getting the url length restriction error. In some posts I see that people reccomend to use this call with parameter , like this :

https://tenant-my.sharepoint.com/personal/user_account_tenant_onmicrosoft_com/_api/web/getfilebyserverrelativeurl(@v)/$value?@v='....' 

But when I'm doing this I'm getting next error :

400 : {"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The query string "serverRelativeUrl" is missing or invalid."}}}

What I'm doing wrong ? I'm doing HTTP GET from Java code.

Thanks

Source Link
SlavaG
  • 121
  • 1
  • 5

URL Length restriction on GetFileByServerRelativeUrl

I'm trying to get file by using GetFileByServerRelativeUrl and getting the url length restriction error. In some posts I see that people reccomend to use this call with parameter , like this :

https://tenant-my.sharepoint.com/personal/user_account_tenant_onmicrosoft_com/_api/web/getfilebyserverrelativeurl(@v)/$value?@v='....' 

But when I'm doing this I'm getting next error : 400 : {"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The query string "serverRelativeUrl" is missing or invalid."}}}

What I'm doing wrong ? I'm doing HTTP GET from Java code.

Thanks