microsoft graph api to get attachment link for a list item











up vote
-1
down vote

favorite
1












I am using Microsoft Graph Beta APIS to access SharePoint Online. The current GET to retrieve a list with its ListItems is like



/beta/sites/mytenant.sharepoint.com:/sites/mysite:/lists/mylist?select=id,name,lastModifiedDateTime&expand=items(expand=fields(select=Title,Attachments,OptyNumber))



This works great and returns me Title, Attachments, and OptyNumber. Now, the list may have attachments and I need the web URL of the attachments. How do I do that?



Trying /beta/sites/mytenant.sharepoint.com:/sites/mysite:/lists/mylist:/attachments



throws error
{
"error": {
"code": "BadRequest",
"message": "Only one path can be specified in the URL.",
"innerError": {
"request-id": "f9e94fee-082f-45af-a777-2e1d3debb99c",
"date": "2018-11-09T03:52:32"
}
}
}


which makes sense to me. How do I get the associated attachment URL with each of a ListItem if it's there?










share|improve this question
























  • You said it is returning Attachments in your original query, what exactly is it returning?
    – Marc LaFleur
    Nov 9 at 17:05










  • a true false if attachment exists or not. but not the actual link
    – Vik
    Nov 9 at 21:50










  • Have tested the endpoint too, the attachment returns Boolean. It maybe by design, so that the graph API doesn't want to return the actual now. You should try to submit one feature request for this.
    – Seiya Su
    Nov 12 at 3:14










  • Is the list a Document Library or just a traditional list? Its possible you need to use the OneDrive API to access the attachment.
    – Marc LaFleur
    Nov 12 at 21:46










  • Sorry to say ms docs are and overall support is pretty lame around these. SO is full of these and no luck. not even a clear yes no on if it is even supported, if no then what is the way.
    – Vik
    Nov 15 at 0:44















up vote
-1
down vote

favorite
1












I am using Microsoft Graph Beta APIS to access SharePoint Online. The current GET to retrieve a list with its ListItems is like



/beta/sites/mytenant.sharepoint.com:/sites/mysite:/lists/mylist?select=id,name,lastModifiedDateTime&expand=items(expand=fields(select=Title,Attachments,OptyNumber))



This works great and returns me Title, Attachments, and OptyNumber. Now, the list may have attachments and I need the web URL of the attachments. How do I do that?



Trying /beta/sites/mytenant.sharepoint.com:/sites/mysite:/lists/mylist:/attachments



throws error
{
"error": {
"code": "BadRequest",
"message": "Only one path can be specified in the URL.",
"innerError": {
"request-id": "f9e94fee-082f-45af-a777-2e1d3debb99c",
"date": "2018-11-09T03:52:32"
}
}
}


which makes sense to me. How do I get the associated attachment URL with each of a ListItem if it's there?










share|improve this question
























  • You said it is returning Attachments in your original query, what exactly is it returning?
    – Marc LaFleur
    Nov 9 at 17:05










  • a true false if attachment exists or not. but not the actual link
    – Vik
    Nov 9 at 21:50










  • Have tested the endpoint too, the attachment returns Boolean. It maybe by design, so that the graph API doesn't want to return the actual now. You should try to submit one feature request for this.
    – Seiya Su
    Nov 12 at 3:14










  • Is the list a Document Library or just a traditional list? Its possible you need to use the OneDrive API to access the attachment.
    – Marc LaFleur
    Nov 12 at 21:46










  • Sorry to say ms docs are and overall support is pretty lame around these. SO is full of these and no luck. not even a clear yes no on if it is even supported, if no then what is the way.
    – Vik
    Nov 15 at 0:44













up vote
-1
down vote

favorite
1









up vote
-1
down vote

favorite
1






1





I am using Microsoft Graph Beta APIS to access SharePoint Online. The current GET to retrieve a list with its ListItems is like



/beta/sites/mytenant.sharepoint.com:/sites/mysite:/lists/mylist?select=id,name,lastModifiedDateTime&expand=items(expand=fields(select=Title,Attachments,OptyNumber))



This works great and returns me Title, Attachments, and OptyNumber. Now, the list may have attachments and I need the web URL of the attachments. How do I do that?



Trying /beta/sites/mytenant.sharepoint.com:/sites/mysite:/lists/mylist:/attachments



throws error
{
"error": {
"code": "BadRequest",
"message": "Only one path can be specified in the URL.",
"innerError": {
"request-id": "f9e94fee-082f-45af-a777-2e1d3debb99c",
"date": "2018-11-09T03:52:32"
}
}
}


which makes sense to me. How do I get the associated attachment URL with each of a ListItem if it's there?










share|improve this question















I am using Microsoft Graph Beta APIS to access SharePoint Online. The current GET to retrieve a list with its ListItems is like



/beta/sites/mytenant.sharepoint.com:/sites/mysite:/lists/mylist?select=id,name,lastModifiedDateTime&expand=items(expand=fields(select=Title,Attachments,OptyNumber))



This works great and returns me Title, Attachments, and OptyNumber. Now, the list may have attachments and I need the web URL of the attachments. How do I do that?



Trying /beta/sites/mytenant.sharepoint.com:/sites/mysite:/lists/mylist:/attachments



throws error
{
"error": {
"code": "BadRequest",
"message": "Only one path can be specified in the URL.",
"innerError": {
"request-id": "f9e94fee-082f-45af-a777-2e1d3debb99c",
"date": "2018-11-09T03:52:32"
}
}
}


which makes sense to me. How do I get the associated attachment URL with each of a ListItem if it's there?







microsoft-graph sharepoint-online






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 9 at 16:59









Marc LaFleur

18.1k31833




18.1k31833










asked Nov 9 at 3:53









Vik

1,88484087




1,88484087












  • You said it is returning Attachments in your original query, what exactly is it returning?
    – Marc LaFleur
    Nov 9 at 17:05










  • a true false if attachment exists or not. but not the actual link
    – Vik
    Nov 9 at 21:50










  • Have tested the endpoint too, the attachment returns Boolean. It maybe by design, so that the graph API doesn't want to return the actual now. You should try to submit one feature request for this.
    – Seiya Su
    Nov 12 at 3:14










  • Is the list a Document Library or just a traditional list? Its possible you need to use the OneDrive API to access the attachment.
    – Marc LaFleur
    Nov 12 at 21:46










  • Sorry to say ms docs are and overall support is pretty lame around these. SO is full of these and no luck. not even a clear yes no on if it is even supported, if no then what is the way.
    – Vik
    Nov 15 at 0:44


















  • You said it is returning Attachments in your original query, what exactly is it returning?
    – Marc LaFleur
    Nov 9 at 17:05










  • a true false if attachment exists or not. but not the actual link
    – Vik
    Nov 9 at 21:50










  • Have tested the endpoint too, the attachment returns Boolean. It maybe by design, so that the graph API doesn't want to return the actual now. You should try to submit one feature request for this.
    – Seiya Su
    Nov 12 at 3:14










  • Is the list a Document Library or just a traditional list? Its possible you need to use the OneDrive API to access the attachment.
    – Marc LaFleur
    Nov 12 at 21:46










  • Sorry to say ms docs are and overall support is pretty lame around these. SO is full of these and no luck. not even a clear yes no on if it is even supported, if no then what is the way.
    – Vik
    Nov 15 at 0:44
















You said it is returning Attachments in your original query, what exactly is it returning?
– Marc LaFleur
Nov 9 at 17:05




You said it is returning Attachments in your original query, what exactly is it returning?
– Marc LaFleur
Nov 9 at 17:05












a true false if attachment exists or not. but not the actual link
– Vik
Nov 9 at 21:50




a true false if attachment exists or not. but not the actual link
– Vik
Nov 9 at 21:50












Have tested the endpoint too, the attachment returns Boolean. It maybe by design, so that the graph API doesn't want to return the actual now. You should try to submit one feature request for this.
– Seiya Su
Nov 12 at 3:14




Have tested the endpoint too, the attachment returns Boolean. It maybe by design, so that the graph API doesn't want to return the actual now. You should try to submit one feature request for this.
– Seiya Su
Nov 12 at 3:14












Is the list a Document Library or just a traditional list? Its possible you need to use the OneDrive API to access the attachment.
– Marc LaFleur
Nov 12 at 21:46




Is the list a Document Library or just a traditional list? Its possible you need to use the OneDrive API to access the attachment.
– Marc LaFleur
Nov 12 at 21:46












Sorry to say ms docs are and overall support is pretty lame around these. SO is full of these and no luck. not even a clear yes no on if it is even supported, if no then what is the way.
– Vik
Nov 15 at 0:44




Sorry to say ms docs are and overall support is pretty lame around these. SO is full of these and no luck. not even a clear yes no on if it is even supported, if no then what is the way.
– Vik
Nov 15 at 0:44

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53219629%2fmicrosoft-graph-api-to-get-attachment-link-for-a-list-item%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53219629%2fmicrosoft-graph-api-to-get-attachment-link-for-a-list-item%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Schultheiß

Verwaltungsgliederung Dänemarks

Liste der Kulturdenkmale in Wilsdruff