# Turning a URL call into a API POST

**URL:** https://community.thunkable.com/t/turning-a-url-call-into-a-api-post/485001
**Category:** Questions about Thunkable X
**Created:** [February 26, 2020, 5:02am UTC](https://community.thunkable.com/t/turning-a-url-call-into-a-api-post/485001 "2020-02-26T05:02:46Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)
#### Post date: [February 26, 2020, 5:02am UTC](https://community.thunkable.com/t/turning-a-url-call-into-a-api-post/485001/1 "2020-02-26T05:02:46Z")

</div>

Hello All… I use [quickchart.io](http://quickchart.io) to make all charts in my app. Currently some of the URL’s are getting crazy long and are impossible to send and have someone use. I am trying to use their API URL shortener but running into issues.

When i kept the charts simple, like this

 ![Screen Shot 2020-02-24 at 11.46.43 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/5/3581a4d329be992f56a32a62702245030b279394.png)  
i was able to do this, no problem.

now i am trying to do this

 ![Screen Shot 2020-02-25 at 11.44.01 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/8/a88829ba99d875dc0f7f969f5cdc50e569aa1a33.png)  
and running into problems. What i dont understand is, am i doing this wrong? Is it because i have a callback function at the very end, perhaps this is incorrectly put into the scheme of things? IDK. what i do know is that this is the code i want to recreate

````auto
  type: 'line',
  data: {
    labels: ['January', 'February', 'March', 'April', 'May'],
    datasets: [
{
      	label: 'Corrects',
      	data: [10, 60, 70, 180, 190], borderWidth:1,pointBackground:'green',
	fill: false,
	borderColor:'green'}, 
{
    	  label: 'Incorrects',
     	 data: [.10, 20, 30, 40, 50], 
	fill: false, 
	borderColor: 'red', pointStyle:'star', pointRadius:4, borderWidth:1
    }]
  },
  options: {
    	title: {
     	 display: true,
      	text: 'BEHAVIORNAMEGOESHERE',
      	fontColor: 'Black',
      	fontSize: 32,
    },
    	legend: {
      	position: 'bottom',
    },
    	scales: {
      
      	yAxes: [{ type: 'logarithmic', 
        
        	ticks: {
        	autoSkip: false,
        	min:.001, max: 1000,callback: function (value, index, values) {if( value==.001 || value==.01 || value==.1 || value==1 || value==10 || value==100 || value==1000){return value + ' per minute';}},}}],},},}```

side note, the code above does create a chart, so it's valid. I just dont think i am building it into the blocks correctly. When i use this code plus the URL starter as the scr for image's it works perfectly.
````

---

<div class="post-metadata">

### Author: ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)
#### Post date: [February 26, 2020, 5:05am UTC](https://community.thunkable.com/t/turning-a-url-call-into-a-api-post/485001/2 "2020-02-26T05:05:42Z")

</div>

And solved… sometimes i need to read my own notes.  
instead of putting the entire thing into blocks, i took what i normally include into the url into the text block and connected it into the chart field block

 ![Screen Shot 2020-02-25 at 11.51.29 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/1/21784c0494161e009659d8e9bcf25284d8c004e6.png)

---

<div class="post-metadata">

### Author: ![ashwani.mathur3difzz](https://avatars.discourse-cdn.com/v4/letter/a/2bfe46/32.png) [@ashwani.mathur3difzz](https://community.thunkable.com/u/ashwani.mathur3difzz)
#### Post date: [May 6, 2020, 10:30pm UTC](https://community.thunkable.com/t/turning-a-url-call-into-a-api-post/485001/3 "2020-05-06T22:30:23Z")

</div>

Hi Jared,

On the same lines, i have been trying to create a POST API but having a hard time in identifying the header and body params. I know the code that i am trying to recreate, so any help will be appreciated. Below is the code i am trying to create. Also at the following link . Which language code do i use? Curl, Java, Node, PHP or Python?

[https://developer.paytm.com/docs/create-link-api/](https://developer.paytm.com/docs/create-link-api/)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/0/3001d279b3ea9e929e115cc14d6b8c4f9bd12e6d.png)

So for the header I need tokentype and signature (checksum string)?  
For the body i need mid, linkName, linkDescription, linktype

The blocks i have are below. I know they are not complete, but i am stuck. Any help is appreciated as always.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/7/27b20022c27a741fc1f973e86cd912f6fd99a07f.png)

---

<div class="post-metadata">

### Author: ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)
#### Post date: [May 6, 2020, 11:19pm UTC](https://community.thunkable.com/t/turning-a-url-call-into-a-api-post/485001/4 "2020-05-06T23:19:20Z")

</div>

Can you copy/paste that whole code for the curl?

---

<div class="post-metadata">

### Author: ![ashwani.mathur3difzz](https://avatars.discourse-cdn.com/v4/letter/a/2bfe46/32.png) [@ashwani.mathur3difzz](https://community.thunkable.com/u/ashwani.mathur3difzz)
#### Post date: [May 7, 2020, 1:28am UTC](https://community.thunkable.com/t/turning-a-url-call-into-a-api-post/485001/5 "2020-05-07T01:28:37Z")

</div>

Thanks for your attention. Here is the code for CURL

curl -X POST ‘[https://securegw-stage.paytm.in/link/create](https://securegw-stage.paytm.in/link/create)’   
–header ‘Content-Type: application/json’   
–data ‘{“body”:{“mid”:"{mid}",“linkType”:"{link-type}",“linkDescription”:"{link-description}",“linkName”:"{link-name}"},“head”:{“tokenType”:“AES”,“signature”:"{signature}"}}’

---

<div class="post-metadata">

### Author: ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)
#### Post date: [May 7, 2020, 1:52am UTC](https://community.thunkable.com/t/turning-a-url-call-into-a-api-post/485001/6 "2020-05-07T01:52:36Z")

</div>

it would look like this

but it’s missing multiple pieces of info. each empy slot should be filled in with values related to the parameters. the example does not hold any true values except for ‘AES’

 ![Screen Shot 2020-05-06 at 9.52.02 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/8/d8ff17470aa4307a0d90b0c8fa208ea2518d17f7.png)

---

<div class="post-metadata">

### Author: ![ashwani.mathur3difzz](https://avatars.discourse-cdn.com/v4/letter/a/2bfe46/32.png) [@ashwani.mathur3difzz](https://community.thunkable.com/u/ashwani.mathur3difzz)
#### Post date: [May 7, 2020, 2:18am UTC](https://community.thunkable.com/t/turning-a-url-call-into-a-api-post/485001/7 "2020-05-07T02:18:19Z")

</div>

Great - Thanks! I understand now how to create the body. I have all the values except for the signature. This is tricky - what the website says that they use the checksum facility. The website says this about the signature

"Signature encryption for validation. It’s value to be sent should be the checksum string created by using [https://developer.paytm.com/docs/checksum](https://developer.paytm.com/docs/checksum)

if i go to this link i see . Which checksum utility should i download? I have the account secret Key. What is compatible with Thunkable? Thanks a lot!

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/c/fce668986770c12747a603958f42a3d8c3ada89d.png)

---

<div class="post-metadata">

### Author: ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)
#### Post date: [November 8, 2024, 11:29am UTC](https://community.thunkable.com/t/turning-a-url-call-into-a-api-post/485001/8 "2024-11-08T11:29:25Z")

</div>


