Giter VIP home page Giter VIP logo

Comments (8)

ChrisMash avatar ChrisMash commented on September 10, 2024

Just tried sending "{}" as the body and that worked, a bit odd though?

from api-docs.

ChrisMash avatar ChrisMash commented on September 10, 2024

I've tried deleting items created through the API that have their ID set to 'Record X'. Sending it to the API as 'record_x' didn't work as the API wants a number and changing it to 'x' seemed to work (returned 204) but it's still there on a refresh....

from api-docs.

jasoncrawford avatar jasoncrawford commented on September 10, 2024

Regarding the “invalid JSON”, are you sending a Content-Type: application/json header with the DELETE request? I think if you do that, it expects a JSON body, and an empty body is not valid JSON. That's why the {} body works. A cleaner solution, I think, is to omit the Content-Type header.

from api-docs.

jasoncrawford avatar jasoncrawford commented on September 10, 2024

Regarding IDs: The API thinks about record IDs as just integers. If you're seeing record bodies that include id: "Record 3" or something similar, it's probably because you have an column in your sheet named “ID”. This will shadow the real ID. The best thing to do is to name that column something else. (Sorry, this is a bit awkward, and we'll come up with a better solution in the future.)

from api-docs.

jasoncrawford avatar jasoncrawford commented on September 10, 2024

The record should be gone from the sheet after you delete it, though. When you say “still there on a refresh”, are you refreshing the sheet view? The record detail page? What exactly?

from api-docs.

ChrisMash avatar ChrisMash commented on September 10, 2024

Yep sending json content type with all requests. Works with the GET request but did wonder if the DELETE was getting confused by that. I'll probably remove it where it's not necessary (making an iOS SDK incidentally, will tell you when it's usable!)

You're right that I have an ID field... For no reason at all.... Especially seeing as there's an underlying one. Probably best to prevent people naming their columns the same as any under the hood for now at least! Or maybe the special Id should be named something like fieldbook_id? Not necessarily an easy change though!

I'll get rid of my id column and see if that works better! Thanks for the help!

from api-docs.

ChrisMash avatar ChrisMash commented on September 10, 2024

Yep, the advice was good, all sorted now!

from api-docs.

jasoncrawford avatar jasoncrawford commented on September 10, 2024

Great! Yes, we plan to have a better way to deal with conflicting field names in the future. For now, if you're using the API, just avoid having an “ID” field.

from api-docs.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.