-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'Invalid Json Payload' error on updateActivities() #67
Comments
@ruggi can you reproduce this? (current test coverage for updateActivities is quite limited) |
@tbarbugli my PHP is quite rusty, but $activity = [
'actor' => 'admin',
'verb' => 'content_published',
'object' => 'Post: Grading Go Bags',
'title' => 'Grading Go Bags',
'started_at' => Array
(
'date' => '2018-08-08 13:42:21.000000',
'timezone_type' => '3',
'timezone' => 'UTC',
),
'status' => 'new status on activity update is published',
'content_url' => 'This is test url to see if activity can be updated using this way.',
'time' => '2018-07-23 14:30:16',
'meta' => Array
(
'post_type' => 'post',
'excerpt' => 'The quality of earthquake survival kits ranges from solid to shaky. We rated several emergency kits on the market to find the survival bag most likely to come in handy when The Big One hits. ',
'category' => 'TOOLS',
'story_headline' => 'Getting Ready for the Big One',
'deck_headline' => 'The quality of earthquake survival kits ranges from solid to shaky',
'author' => 'Beth Spotswood',
'thumbnail' => Array
(
'url' => 'http://localhost/altaonline.com/wp-content/uploads/2018/06/ATA050118starwars_img01.jpg',
'alt' => '',
)
),
'foreign_id' => '3798',
];
$feed->addActivity($activity);
// ...
$client->updateActivity($activity);
// ... is working fine for me. Could you give us some more info about how the activity object is built @atieq-rehman-confiz ? |
my usecase is as follow;
the snapshot of activity data of new & update post is compared and it looks exactly same. |
// load from db |
Most likely the problem is that the API is expecting an array of activities to update, while you're probably providing only one. You can use the
|
Got it fixed, @ruggi is correct, input was wrong for |
here is the data being posted to updateActivities() method [which is exactly same when new activity is added]
(
[actor] => admin
[verb] => content_published
[object] => Post: Grading Go Bags
[title] => Grading Go Bags
[started_at] => Array
(
[date] => 2018-08-08 13:42:21.000000
[timezone_type] => 3
[timezone] => UTC
)
)
and it says 'Invalid JSON Payload with following trace
The text was updated successfully, but these errors were encountered: