publish at a specific time in the future instead

68 views
Skip to first unread message

Daniel F. S.

unread,
Mar 21, 2012, 9:50:24 AM3/21/12
to Tumblr API Discussion
I find the error in my source code.I want to postpone the publication
of a post.
This is part of my source code:

===================================================
$time = "2012-03-21 12:18:00"; //date to pospone


if($time !== ""){
$time = str_replace (" ", "T", "$time"); //make date string
0000-00-00T00:00:00
$estado = 'publish-on='.$time; //write value
}else{$estado = 'queue';}




switch ($post_type) {
case "photo":
$request_data = http_build_query(
array(

'email' => $tumblr_email,
'password' => $tumblr_password,
'type' => $post_type,
'caption' => $post_title,
'source' => $data,
'tags' => $tags,
'state' => $estado, //put value to string
'group' => $group,
'generator' => $generado,
'date' => $date
)
);
break;
default:
}
===================================================

$estado show: publish-on=2012-03-21T12:18:00
The server responds: Error (400): Invalid state value

Where is the problem?



PD: sorry for my English & thx.

Daniel F. S.

unread,
Mar 22, 2012, 8:55:58 AM3/22/12
to Tumblr API Discussion
Help me please!!!

PD: I am using api v1

joshf

unread,
May 8, 2012, 11:19:33 AM5/8/12
to Tumblr API Discussion
I'm not sure about V1, but try defining the following parameters:

'state' => 'queue',
'publish-on' => $time

In V2, I know it's 'publish_on', so try that if the above doesn't
work.

jf


On Mar 21, 8:50 am, "Daniel F. S." <bytte...@gmail.com> wrote:
> I find the error in my source code.I want to postpone the publication
> of a post.
> This is part of my source code:
>
> ===================================================
> $time = "2012-03-21 12:18:00"; //dateto pospone
Reply all
Reply to author
Forward
0 new messages