koltyakov / gosip

⚡️ SharePoint SDK for Go
https://go.spflow.com
MIT License
140 stars 32 forks source link

add GetQuery, update GetFileById and GetReader #57

Closed zubairk14 closed 1 year ago

zubairk14 commented 1 year ago

When submitting a PR, please make sure you to:

koltyakov commented 1 year ago

@zubairk14 are you constructing endpoints from a base site?

client := &gosip.SPClient{AuthCnfg: auth} // SiteURL: https://contoso.sharepoint.com/sites/site

sp := api.NewSP(client)

data, err := sp.Web().GetFileById('{file-unique-id}').Get()

As chain methods take care building correct API endpoints, and the changes you're applying tell me that probably the base URL you provided is not the root of the site.

zubairk14 commented 1 year ago

hey andrew, didn't mean to open this PR but really appreciate how quickly you responded!

i had added GetQuery() to my personal fork of your lib b/c I was running into errors with __request_metadata__ when submitting PostQuery() requests with a bearer token derived from Microsoft's Graph Oauth2 flow.

please feel free to close/ignore this PR

koltyakov commented 1 year ago

@zubairk14 Do you have a sample or tech description which you're trying to solve? Just interesting, how could I help you.