# Create Topic from Google App Script

**URL:** https://meta.discourse.org/t/create-topic-from-google-app-script/143704
**Category:** Development
**Created:** [March 9, 2020, 3:51pm UTC](https://meta.discourse.org/t/create-topic-from-google-app-script/143704 "2020-03-09T15:51:19Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Krischan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/krischan/32/47290_2.png) [@Krischan](https://meta.discourse.org/u/Krischan)
#### Post date: [March 9, 2020, 3:51pm UTC](https://meta.discourse.org/t/create-topic-from-google-app-script/143704/1 "2020-03-09T15:51:19Z")

</div>

I’d like to create topics from a Google spreadsheet using Google App Script. My code looks like this, but I get a error message (400) when I run it:

```
function publishspeaker() {

var url = "https://1e9.community/posts.json";
  
var options = {
"method": "post",
"headers": {
"Content-Type": "multipart/form-data",
"Api-Username": "XXX",
"Api-Key": "Here_is_the_API_Key" 
},
"payload": {
"title": "This is a test",
"raw": "This is a test",
"category": 63
}   
};
var response = UrlFetchApp.fetch(url, options);
Logger.log(response) 
}

```

Apparently, the category is invalid, but I don’t know why:

> {“errors”:[“Du hast bei der Anfrage ungültige Parameter angegeben: category”],“error\_type”:“invalid\_parameters”}

Any ideas? Thanks!

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [February 25, 2024, 3:06am UTC](https://meta.discourse.org/t/create-topic-from-google-app-script/143704/2 "2024-02-25T03:06:40Z")

</div>


