# Please, help me. API Post method, I want to solve it

**URL:** https://discourse.processing.org/t/please-help-me-api-post-method-i-want-to-solve-it/29328
**Category:** Libraries
**Created:** [April 13, 2021, 12:18pm UTC](https://discourse.processing.org/t/please-help-me-api-post-method-i-want-to-solve-it/29328 "2021-04-13T12:18:41Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)
#### Post date: [April 13, 2021, 12:18pm UTC](https://discourse.processing.org/t/please-help-me-api-post-method-i-want-to-solve-it/29328/1 "2021-04-13T12:18:41Z")

</div>

API pdf file :

> **[게이트웨이\_API.pdf](https://drive.google.com/file/d/16_zMOHNv-UjHtFjXKGaHco5M21iTBa-m/view?usp=sharing)**
>
> Google Drive file.

```auto
import http.requests.*;

public void setup(){
  PostRequest post = new PostRequest("https://getefento.com/"); // api/v2/measurements
  post.addHeader("Content-Type", "application/json");
  post.addHeader("charset", "UTF-8"); 
  post.addHeader("X-ApiToken", "----");
  post.addHeader("serial", "[string]");
  post.send(); 
  
  println(post.getContent()); 
  
  noLoop();
  
}

public void draw(){
  
}

```

I can’t solve it even if I put this and that source code.

If you know how to fix, please help.

I try to write the source code while viewing the pdf file, but I cannot receive the data.

- manual url : [https://getefento.com/wp-content/uploads/2020/11/2020-11-20-Efento-Gateway-user-manual.pdf](https://getefento.com/wp-content/uploads/2020/11/2020-11-20-Efento-Gateway-user-manual.pdf)

---

<div class="post-metadata">

### Author: ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)
#### Post date: [April 13, 2021, 6:36pm UTC](https://discourse.processing.org/t/please-help-me-api-post-method-i-want-to-solve-it/29328/2 "2021-04-13T18:36:53Z")

</div>

Hi,

Can you describe your issue more precisely? What are you trying to do? What doesn’t work?

Providing a Google drive link is not the best idea because personally I can’t access it (don’t have the rights) 😀

Is there an error message in the console?

---

<div class="post-metadata">

### Author: ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)
#### Post date: [April 13, 2021, 8:00pm UTC](https://discourse.processing.org/t/please-help-me-api-post-method-i-want-to-solve-it/29328/3 "2021-04-13T20:00:29Z")

</div>

The link has been modified so that you can view the material.

1. How to write the end point?

2. How to make a post form?

I wonder.

---

<div class="post-metadata">

### Author: ![SomeOne](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/someone/32/8639_2.png) [@SomeOne](https://discourse.processing.org/u/SomeOne)
#### Post date: [April 17, 2021, 7:39am UTC](https://discourse.processing.org/t/please-help-me-api-post-method-i-want-to-solve-it/29328/4 "2021-04-17T07:39:10Z")

</div>

Hi,

With post method you need three things:

1. URL - what service you are using
2. Headers - metadata and authentications
3. Payload - data you are sending

Headers seem ok. Your current URL is the root of the server. In document they mention endpoint for measurements `/api/v2/measurements`. So URL for it would be `https://getefento.com/api/v2/measurements`.  
In headers and in manual payload format it JSON. On page 11 there is given structure for measurement and an example. I you are not familiar with JSON google it. Java has libraries to make working with JSON easier.
