Hi,

Did anyone achieve blog post creation using Ning PHP API?

With the folowing PHP code:

try {
 $args = array("author"=> "39azntkcdxn3r");
 $result = NingApi::instance()->user->fetch($args);
 print_r($result["success"]);
 
 $values = array (
 "title" => "Registro de peso",
 "publishStatus" => "publish",
 /*"publishTime" => "now",*/
 "publishTime" => "2012-07-03T00:00:00.000Z",
 "description" => "my first blog post",
 "visibility" => "me",
 "approved" => "true");
 
 $result = NingApi::instance()->blogPost->create($values);

 print_r($result);
 
}
catch (Exception $e)
{
 print_r($e);
}

I get the following output:

1NingException Object
(
    [httpStatus:NingException:private] =>
    [ningCode:NingException:private] =>
    [ningSubcode:NingException:private] =>
    [ningTrace:NingException:private] =>
    [message:protected] =>
    [string:Exception:private] =>
    [code:protected] => 0
    [file:protected] => /var/www/redemae/testeswidgets/public_html/ningapi/NingException.php
    [line:protected] => 56
    [trace:Exception:private] => Array
        (
            [0] => Array
                (
                    [file] => /var/www/redemae/testeswidgets/public_html/ningapi/NingApi.php
                    [line] => 233
                    [function] => generate
                    [class] => NingException
                    [type] => ::
                    [args] => Array
                        (
                            [0] =>
                        )

)

[1] => Array
                (
                    [file] => /var/www/redemae/testeswidgets/public_html/ningapi/NingApi.php
                    [line] => 240
                    [function] => call
                    [class] => NingApi
                    [type] => ->
                    [args] => Array
                        (
                            [0] => BlogPost
                            [1] => POST
                            [2] => Array
                                (
                                    [title] => Registro de peso
                                    [publishStatus] => publish
                                    [publishTime] => 2012-07-03T00:00:00.000Z
                                    [description] => my first blog post
                                    [visibility] => me
                                    [approved] => true
                                )

[3] =>
                            [4] =>
                        )

)

[2] => Array
                (
                    [file] => /var/www/redemae/testeswidgets/public_html/ningapi/NingObject.php
                    [line] => 46
                    [function] => post
                    [class] => NingApi
                    [type] => ->
                    [args] => Array
                        (
                            [0] => BlogPost
                            [1] => Array
                                (
                                    [title] => Registro de peso
                                    [publishStatus] => publish
                                    [publishTime] => 2012-07-03T00:00:00.000Z
                                    [description] => my first blog post
                                    [visibility] => me
                                    [approved] => true
                                )

)

)

[3] => Array
                (
                    [file] => /var/www/redemae/testeswidgets/public_html/ningapi/objects/NingBlogPost.php
                    [line] => 21
                    [function] => create
                    [class] => NingObject
                    [type] => ->
                    [args] => Array
                        (
                            [0] => Array
                                (
                                    [title] => Registro de peso
                                    [publishStatus] => publish
                                    [publishTime] => 2012-07-03T00:00:00.000Z
                                    [description] => my first blog post
                                    [visibility] => me
                                    [approved] => true
                                )

)

)

[4] => Array
                (
                    [file] => /var/www/redemae/testeswidgets/public_html/createBlogPost.php
                    [line] => 18
                    [function] => create
                    [class] => NingBlogPost
                    [type] => ->
                    [args] => Array
                        (
                            [0] => Array
                                (
                                    [title] => Registro de peso
                                    [publishStatus] => publish
                                    [publishTime] => 2012-07-03T00:00:00.000Z
                                    [description] => my first blog post
                                    [visibility] => me
                                    [approved] => true
                                )

)

)

)

[previous:Exception:private] =>
)

Any help would be appreciated.

Views: 172

Reply to This

Replies to This Discussion

No news to me... is bad news...

Please help!!

Reply to Discussion

RSS

Blog Posts

Getting Started

Posted by Kyle Ford on October 13, 2010 at 8:00am 3 Comments

A Note on API Pricing

Posted by Phil McCluskey on October 1, 2010 at 8:55am 0 Comments

Welcome to Build!

Posted by Kyle Ford on September 30, 2010 at 8:30pm 1 Comment

Ning Status

All systems Go!

All Ning Networks are fully operational and speedy. Things are humming along nicely.

© 2017   Created by Build Team.   Powered by

Badges  |  Report an Issue  |  Terms of Service