Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/295.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Webpushr API在查询时发送_Php_Json_Curl - Fatal编程技术网

Php Webpushr API在查询时发送

Php Webpushr API在查询时发送,php,json,curl,Php,Json,Curl,我正试图通过webpushr.com上的api向特定用户发送browsernotification 根据API,我必须使用'send_at'键和UTC时间字符串通过POST发送JSON 我已尝试将此JSON发送到API {"title":"This is my message header","message":"No description for this message","target_url":"https:\/\/my.homepage.biz","send_at":"2020-03

我正试图通过webpushr.com上的api向特定用户发送browsernotification

根据API,我必须使用'send_at'键和UTC时间字符串通过POST发送JSON

我已尝试将此JSON发送到API

{"title":"This is my message header","message":"No description for this message","target_url":"https:\/\/my.homepage.biz","send_at":"2020-03-08 00:10","sid":"REMOVED_FOR_SECURITYREASONS"}
消息被记录在webpushr上,内容、发送日期和我发布的所有内容都正常。但当我发布数据时,信息会立即传递

我将通过PHP&cURL发送所有内容,并收到以下响应:

{"status":"success","description":"Notification sent successfully.","ID":REMOVED FOR SECURITY}
____编辑_____ 好的,文档中指出它应该是delta UTC time fx。2019-04-03 18:00+01:30

我也试过了。。这是我在UTC时间19:57发布的JSON

{"title":"{"title":"This is my message header","message":"No description for this message","target_url":"https:\/\/my.homepage.biz","send_at":"2020-03-04 19:57 +01:10","sid":"REMOVED_FOR_SECURITYREASONS"}
这应该给我1小时10分钟的通知

下面是JSON响应

{"status":"failure","type":"invalid_value","description":"Schedule date must be at least 5 minutes in future"}

有什么建议吗?

与发送到prameter相关的文档不正确,已更新。发送地址应以UTC格式定义。例如:PST调度时间2020-03-04 1330旧金山时间,它应该表示为2020 03-04 1330-08:00,因为PST是8小时后UTC。由于您在丹麦,您目前比UTC提前1小时到达夏季时间,因此您将发送时间定义为YYYY-MM-DD HH:MM+01:00,其中HH:MM将是您的丹麦当地时间。

您的日期没有偏移时间。根据文档-UTC偏移量是特定地点和日期与协调世界时UTC的小时和分钟差。它通常以±[hh]:[mm]、±[hh][mm]或±[hh]的格式显示。因此,如果所描述的时间比UTC提前一个小时,例如冬季在柏林的时间,UTC偏移量将为+01:00、+0100,或者简单地说是+01。如果您希望在将来的计划时间发送通知,您可以从WebPushr设置此值。格式以增量到UTC表示。示例:2019-10-1019:31+5:30@JayBlanchard我百分之百地跟随你。我也有同样的想法,也尝试过。我将用更多信息更新我的问题……您所在的位置的UTC是多少?例如,我现在的UTC是22:00-5:00,我在丹麦,所以它应该是+1,直到夏天,然后它是+2