Error in getting transaction params using purestack api it shows a 400 status error its on testnet

I am getting a issue like this:

{"status":400,"response":{"req":{"method":"GET","url":"","headers":{"x-api-key":"My perfectly correct key","accept":"application/json"}},"header":{"content-type":"application/json","content-length":"108","connection":"close","date":"Tue, 08 Jun 2021 02:58:56 GMT","x-amzn-requestid":"2b3f9683-8efd-427a-970d-f8258dde7c85","x-amz-apigw-id":"Ald1lFSsYosFkvA=","x-amzn-trace-id":"Root=1-60bedcf0-46f5704b122ef65741404d0b","x-cache":"Error from cloudfront","via":"1.1 (CloudFront)","x-amz-cf-pop":"DEL54-C4","x-amz-cf-id":"gXeZCpGdYWqyN9Af5tbkrksdYWO8L2pF8vBi7qpBswvcxgh2VljXrg=="},"status":400,"text":"{\"message\":\"invalid input: unable to parse base32 digest data 'txid': illegal base32 data at input byte 0\"}\n"}}

and the code is:

async makeTransaction() {
        try {
            const baseServer = "";
            const port = "";

            const token = {
              "X-API-key": "Again my perfectly correct key",

            const account = "account address";
            const algodClient = new algosdk.Algodv2(token, baseServer, port);
            let acc = await algodClient.accountInformation(account).do();
            let params = await algodClient.getTransactionParams().do();
            return params;
        } catch (e) {
            return e;

Please somebody help.


Some minor changes are needed in your code:
async makeTransaction() {
async function makeTransaction() {

Reason: otherwise you get syntax error

const baseServer = "";
const baseServer = "";

Reason: you specified the index server as the base server

I hope this helps…
Good luck!

1 Like

Thanks so much it helped a lot :slightly_smiling_face: