readmeio/api

Sorry, `someAction` does not appear to be a valid operation on this API.

Parth909 opened this issue · 4 comments

Actual Error

Error: Sorry, `getVouchersApi` does not appear to be a valid operation on this API.
    at Proxy.<anonymous> (/mnt/c/Users/Bruce/Documents/workspace/CoinPlanet/xoxoday_server/node_modules/api/dist/index.js:179:47)
    at step (/mnt/c/Users/Bruce/Documents/workspace/CoinPlanet/xoxoday_server/node_modules/api/dist/index.js:33:23)
    at Object.next (/mnt/c/Users/Bruce/Documents/workspace/CoinPlanet/xoxoday_server/node_modules/api/dist/index.js:14:53)
    at fulfilled (/mnt/c/Users/Bruce/Documents/workspace/CoinPlanet/xoxoday_server/node_modules/api/dist/index.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

I am referring the docs mentioned here https://helpcenter.xoxoday.com/reference/get-vouchers-api. Although it is working in the docs (on providing my access token) when i perform the same action in my localhost server it is not working.

The above error is being shown. The version is also exactly the same. Even the example is the same.

It is working in the docs but not in my localhost server.

const { pool} = require("../../server");
const sdk = require("api")("@xoxoday/v1.0#d550oavlgo466vx");

// =========== TEST =============

// Retrieve all from the database.
exports.testController = async (req, res) => {
  try {
    const query = {
      text: 'SELECT COUNT(*) FROM "Users"',
    };

    const users = await pool.query(query);
    console.log(users);

    sdk.auth(".........my_access_token..........");
    sdk
      .getVouchersApi({
        query: "plumProAPI.mutation.getVouchers",
        tag: "plumProAPI",
        variables: {
          data: {
            limit: 10,
            page: 1,
            exchangeRate: 1,
            sort: { field: "name", order: "ASC" },
          },
        },
      })
      .then(({ data }) => console.log(data))
      .catch((err) => console.error(err));

    return res.status(200).json({
      usersCount: users.rows,
      // vouchers: vouchers,
    });
  } catch (error) {
    console.log(error);
  }
};

Hi! It looks like the API Registry entry for that API has been a bit corrupted and doesn't have any documented endpoints.

Screen Shot 2023-10-20 at 10 22 43 AM

This is unfortunately a known rare quirk in our registry system and something we're working towards resolving but we sadly don't have a workaround for you for this right now. 😞

Hi, Can you suggest a workaround bcz I have paid a lot of money to use this API 😭. Sorry, but will downgrading or using some other version will it work?

If the endpoint is corrupted. Then how is it working in the docs

Can it be fixed if they do something from their side. Like release a new version or something like that?

It works on the docs because those docs aren't using the api library to make request in the browser, and thereby don't use this API Registry system. Unfortunately cannot be fixed from their site but we're slowly working on fixes it's just a tough problem to solve with how rare it happens.

You can still use their API, just not through the api library. On https://helpcenter.xoxoday.com/reference/get-vouchers-api you can click on this little arrow to see other code snippets for Node HTTP libraries:

Screen Shot 2023-10-20 at 11 09 39 AM

Thank You @erunion . I thought using it via api library was the only way