Send a timstamp in JSON via Postman

I'm fairly new to working with REST APIs and Postman and I'm looking for a way to include a timestamp as a string in a POST request body via Postman.

According to the Postman docs, there is a dynamic variable {{$timestamp}} which can be used in the request body. However, when I try to use it, I get a 400 back from the endpoint I am POSTing to with the message "malformed data."

Here are a couple of variations I have tried:

variation 1

[
    {
        "from_number": "+123456789",
        "messages": [
            {
                "text":  "Message at" {{$timestamp}},
                "to_number": "+123456789"
            }
        ]
    }
]

variation 2

[
    {
        "from_number": "+123456789",
        "messages": [
            {
                "text":  "Message at {{$timestamp}}",
                "to_number": "+123456789"
            }
        ]
    }
]

variation 3

[
    {
        "from_number": "+123456789",
        "messages": [
            {
                "text":  "Message at " + {{$timestamp}},
                "to_number": "+123456789"
            }
        ]
    }
]

All of these have returned the same error

{
  "errorMessage": "malformed data",
  "error": true
}

Thanks @NimS and @JAAulde: Varation 2 is the correct answer. The problem must have been a typo.

链接地址: http://www.djcxy.com/p/48526.html

上一篇: 如何从Json苗条响应中使用邮递员检索HTTP代码?

下一篇: 通过邮递员在JSON中发送一个timstamp