fulcrumapp/fulcrum-js

Records API inconsistencies

Closed this issue · 3 comments

I have some applications that still depend on v1 (v1.6) of this application. But I have started noticing some oddities when searching on records.

When I search records for a form, I get 0 results, which is not correct.

If I try another form, sometimes it works. My code looks like this:

const Fulcrum = require('fulcrum-app');
const f = new Fulcrum({ api_key: my_api_key });
f.records.search({ form_id: my_form_id }, (err, resp) => {
  if (err) {
    throw new Error(err);
  }
  
  console.info(resp);
});

On further investigation, I found that fulcrum-app is making the request to:

https://api.fulcrumapp.com/api/v2/records

instead of

https://api.fulcrumapp.com/api/v2/records.json

If I run the same requests with curl, I find that some searches work against the first (without .json) endpoint, where others return 0 records. And they all seem to work against the .json endpoint as expected.

Is this a known bug in v1? Anyway to work around it? Have I completely lost my marbles?

Thanks

Hi Eric. The above example seems to work for me. Below is my slightly modified code that works well at RunKit.

const Fulcrum = require('fulcrum-app@1.6.0');

const token = process.env.FULCRUM_API_TOKEN;
const client = new Fulcrum({api_key: token});

const searchParams = {
  form_id: 'a9b1a2e8-0003-4644-8685-4aa3ace23864',
  per_page: 1,
  page: 1
};

client.records.search(searchParams, (err, resp) => {
  if (err) {
    console.log('error', err);
  }
  
  console.info(resp.records.length);
});

Is there a specific form id that isn't working? Do you have any other info on why v2 doesn't work for you? I recently updated the library to include the signatures endpoint you added a while back and somehow didn't make it to v2 :( It's there now though.

Sending you the info via Slack.

I do intend to support v2 - was just hoping for quick explanation for my own sanity. I fully understand that you no longer support v1 officially.

I think we cleared this up? If not we can open it back up again.