# Can anyone help me make this postman api integration? please

**URL:** <https://community.postman.com/t/can-anyone-help-me-make-this-postman-api-integration-please/32901>\
**Category:** Help Hub\
**Tags:** newman-project, integrations, help, authentication, api\
**Created:** [February 24, 2022, 4:00am UTC](https://community.postman.com/t/can-anyone-help-me-make-this-postman-api-integration-please/32901 "2022-02-24T04:00:37Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![satellite-administr3](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@satellite-administr3](https://community.postman.com/u/satellite-administr3)\
**Post date:** [February 24, 2022, 4:00am UTC](https://community.postman.com/t/can-anyone-help-me-make-this-postman-api-integration-please/32901/1 "2022-02-24T04:00:37Z")

</div>

**Your question may already have an answer on the community forum. Please search for related topics, and then read through the [guidelines](https://community.postman.com/t/about-the-just-getting-started-category/37) before creating a new topic.**

> Here’s an outline with best practices for making your inquiry.

_My question_:  
I have api integration, but I can’t understand how to make it in postman, please help me

_Details (like screenshots)_:  
API doc : [LineBank\_API\_spec\_DebitCardDev\_201111.pdf - Google Drive](https://drive.google.com/file/d/1HwKBGN7a9840rv7zAj_gW5cXrvcjuJX_/view?usp=sharing)

_How I found the problem_:

_I’ve already tried_:  
I already tried, but still error T.T

 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/c/c625fcd697caf05b6d5fb599376cbbba323d8b82.png)

---

<div class="post-metadata">

**Author:** ![w4dd325](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/w4dd325/32/12436_2.png) [@w4dd325](https://community.postman.com/u/w4dd325)\
**Post date:** [February 24, 2022, 3:17pm UTC](https://community.postman.com/t/can-anyone-help-me-make-this-postman-api-integration-please/32901/2 "2022-02-24T15:17:42Z")

</div>

Hi @satellite-administr3

Your headers are plain text but the documentation says they need to be base64 encoded;

 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/2/286f66112b92121cf18f52ad0dfb7785b6094668.png)

You could do this in the “PreReq” tab using;

```auto
let myVal = pm.collectionVariables.get("string");
var encodedData = btoa(myVal);
console.log(encodedData);

```

“string” would be set as a collection variable with the following string of data (_taken from the example doc, change to your values as appropriate_);

```auto
{"globalId":"20190131GIBLnbPTGLBS000000000701","langCd":" EN","sysCd":"PT","instCd":"1234", "ipv6Adr":"172.16.158.86",
"chnlType":"LNA","mediaCd":"12","deviceId":"DB9267B0B6D63A10","mobileOsCd":"A8.1","reqUrlAdr":"/v1/sign/01101","reqTs":"15
52901544869","svcId":"01101"}

```

Example;

![image](https://us1.discourse-cdn.com/getpostman/original/2X/0/0f3cad6c6f281edc55358ae3ec0c9ef96553da44.png)

 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/7/733072cea7bd362b16d8fd6307c9d256e1db9cb4.png)

---

<div class="post-metadata">

**Author:** ![satellite-administr3](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@satellite-administr3](https://community.postman.com/u/satellite-administr3)\
**Post date:** [February 25, 2022, 7:47am UTC](https://community.postman.com/t/can-anyone-help-me-make-this-postman-api-integration-please/32901/3 "2022-02-25T07:47:42Z")

</div>

Hi @w4dd325 thanks for response

I tried but still error, can you tell me where is the problem?

 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/9/9ff62fe21969b6f020ae75d8b9e5c0e65ce16d82.png)

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/e/8/e8dc144e6d530d337fc4472203a63ec7bd005aec.png)

---

<div class="post-metadata">

**Author:** ![sahuvikramp](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/sahuvikramp/32/10828_2.png) [@sahuvikramp](https://community.postman.com/u/sahuvikramp)\
**Post date:** [February 25, 2022, 11:12am UTC](https://community.postman.com/t/can-anyone-help-me-make-this-postman-api-integration-please/32901/4 "2022-02-25T11:12:42Z")

</div>

Good one @w4dd325, @satellite-administr3 referring your screenshot there is issue with pre-request script. Can you share your pre-request script?

---

<div class="post-metadata">

**Author:** ![satellite-administr3](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@satellite-administr3](https://community.postman.com/u/satellite-administr3)\
**Post date:** [February 25, 2022, 12:32pm UTC](https://community.postman.com/t/can-anyone-help-me-make-this-postman-api-integration-please/32901/5 "2022-02-25T12:32:43Z")

</div>

@sahuvikramp is is my pre-req :

> let myVal = pm.collectionVariables.get(“string”);  
> var encodedData = btoa(myVal);  
> console.log(encodedData);

---

<div class="post-metadata">

**Author:** ![sahuvikramp](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/sahuvikramp/32/10828_2.png) [@sahuvikramp](https://community.postman.com/u/sahuvikramp)\
**Post date:** [February 25, 2022, 12:50pm UTC](https://community.postman.com/t/can-anyone-help-me-make-this-postman-api-integration-please/32901/6 "2022-02-25T12:50:35Z")

</div>

@satellite-administr3 looks like variable value is not available, please try saving your request and give it a shot.

---

<div class="post-metadata">

**Author:** ![satellite-administr3](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@satellite-administr3](https://community.postman.com/u/satellite-administr3)\
**Post date:** [March 1, 2022, 5:25am UTC](https://community.postman.com/t/can-anyone-help-me-make-this-postman-api-integration-please/32901/7 "2022-03-01T05:25:55Z")

</div>

I tried still error 😭 @sahuvikramp @w4dd325

---

<div class="post-metadata">

**Author:** ![satellite-administr3](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@satellite-administr3](https://community.postman.com/u/satellite-administr3)\
**Post date:** [March 1, 2022, 6:27am UTC](https://community.postman.com/t/can-anyone-help-me-make-this-postman-api-integration-please/32901/8 "2022-03-01T06:27:30Z")

</div>

can you share full this postman script? @w4dd325

 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/7/733072cea7bd362b16d8fd6307c9d256e1db9cb4.png)

---

<div class="post-metadata">

**Author:** ![w4dd325](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/w4dd325/32/12436_2.png) [@w4dd325](https://community.postman.com/u/w4dd325)\
**Post date:** [March 1, 2022, 1:05pm UTC](https://community.postman.com/t/can-anyone-help-me-make-this-postman-api-integration-please/32901/9 "2022-03-01T13:05:31Z")

</div>

The “full script” is everything i shared in code above.

A variable with your params  
and then the pre-req script.

Can you share what you tried with screenshots and the output in console?

---

<div class="post-metadata">

**Author:** ![satellite-administr3](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@satellite-administr3](https://community.postman.com/u/satellite-administr3)\
**Post date:** [March 2, 2022, 5:47am UTC](https://community.postman.com/t/can-anyone-help-me-make-this-postman-api-integration-please/32901/10 "2022-03-02T05:47:39Z")

</div>

@w4dd325  
variable:

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/3/f/3f9d581da890c45793e37a5256a01e31ffccdc7c.png)

test:

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/6/e/6e4ba878e1e63e4b8dde3744430d4bbc31e7cf7f.png)

Error:  
There was an error in evaluating the test script: TypeError: Cannot read property ‘toString’ of undefined

---

<div class="post-metadata">

**Author:** ![w4dd325](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/w4dd325/32/12436_2.png) [@w4dd325](https://community.postman.com/u/w4dd325)\
**Post date:** [March 4, 2022, 9:29pm UTC](https://community.postman.com/t/can-anyone-help-me-make-this-postman-api-integration-please/32901/11 "2022-03-04T21:29:33Z")

</div>

I managed to recreate your error by “not saving the variable”.

Make sure you have **saved the changes** before submitting the call.
