# PUTで文字列1行にjson文字列を入れたい

**URL:** <https://community.cybozu.dev/t/topic/7472>\
**Category:** kintone 開発相談\
**Created:** [April 13, 2021, 10:28am UTC](https://community.cybozu.dev/t/topic/7472 "2021-04-13T10:28:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Legacy\_Account1201](https://avatars.discourse-cdn.com/v4/letter/l/f04885/32.png) [@Legacy\_Account1201](https://community.cybozu.dev/u/Legacy_Account1201)\
**Post date:** [April 13, 2021, 10:28am UTC](https://community.cybozu.dev/t/topic/7472/1 "2021-04-13T10:28:46Z")

</div>

**背景・実現したいこと**

PUTで文字列1行にjson文字列を入れたい

**エラー情報**

&nbsp;不正なjson文字列です

**利用したソースコード**

body

* * *

{

&nbsp; &nbsp; “app”:160,

&nbsp; &nbsp; &nbsp; &nbsp; “records”:[

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{“id”:59875,“record”:

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {“S1\_kakobackup”:{“value”:“{“data”:{“name”:“test”}}”}}

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }

&nbsp; &nbsp; &nbsp; &nbsp; ]

}

* * *

S1\_kakobackupというフィールドに

{“data”:{“name”:“test”}}

というJson文字列を入れたい。

フィールドは文字列1行です。

これ以外の普通の文字列ではエラーは出ません。

使用言語はRです。

&nbsp;

どなたかおわかりになる方がいらっしゃったらお教えいただけますでしょうか。

よろしくお願い申し上げます。

---

<div class="post-metadata">

**Author:** ![Legacy\_Account1740](https://avatars.discourse-cdn.com/v4/letter/l/ed8c4c/32.png) [@Legacy\_Account1740](https://community.cybozu.dev/u/Legacy_Account1740)\
**Post date:** [April 13, 2021, 10:41am UTC](https://community.cybozu.dev/t/topic/7472/2 "2021-04-13T10:41:14Z")

</div>

takigawaさん

文字列にダブルクォーテーションを含む場合は、バックスラッシュでエスケープすると良いと思います。  
[https://www.ipentec.com/document/json-character-escape](https://www.ipentec.com/document/json-character-escape)

---

<div class="post-metadata">

**Author:** ![Legacy\_Account1201](https://avatars.discourse-cdn.com/v4/letter/l/f04885/32.png) [@Legacy\_Account1201](https://community.cybozu.dev/u/Legacy_Account1201)\
**Post date:** [April 14, 2021, 12:05am UTC](https://community.cybozu.dev/t/topic/7472/3 "2021-04-14T00:05:19Z")

</div>

江田様

ありがとうございます。

単純なミスで恐縮です。

無事に解決いたしました。

大変助かりました。
