Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image upload support? #52

Closed
Worie opened this issue Apr 19, 2022 · 2 comments
Closed

Image upload support? #52

Worie opened this issue Apr 19, 2022 · 2 comments

Comments

@Worie
Copy link

Worie commented Apr 19, 2022

Hello,
I've read various threads about the support for uploading imagery - and apparently it should be available, right?

Yet when I look at the Webflow.js file here https://github.com/webflow/js-webflow-api/blob/master/src/Webflow.js#L220
I can see that images are commented out as TODO

How can I upload an image to webflow site, and get the usable url back?

@johnagan
Copy link
Contributor

Hi Worie 👋

I don't believe this SDK supports the binary upload yet. It is on my list to dig into though.

I'd be open to pairing on a PR if you have time to dig in before I do.

@johnagan
Copy link
Contributor

alright.. scratch what I said above. It seems to work fine since we're pulling from a URL rather than a local file. I'm not sure why the code says TODO.

Here's my working test:

api.post("/collections/[collection id]/items", {
  fields: {
    name: "Exciting blog post title",
    slug: "exciting-post",
    _archived: false,
    _draft: false,
    image: "https://d39f23jfph0ylk.cloudfront.net/somesite.com.jpg"
  }
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants