The default field on the Activity API doesn't return 'result' field by default, or even when specified as a return value. I've never added one of these before, if someone could let me know how it's done I'll sort a PR out. Thanks!

If anyone's interested - the use case is deleting Twilio's copy of messages after a period on a scheduled job. The return value is Twilio's SMS Unique ID.

  • I think there is some weird logic that blocks it somewhere in the code for reasons unclear
    – user4278
    Jul 21, 2018 at 0:20

1 Answer 1


Api result doesn't return if the fields value is NULL. In your case result field must be NULL for the activity you trying to get. Try using to check if the result key is present in api result and use accordingly.

$result = CRM_Utils_Array::value('result', $activityResults); or !empty($activityResults['result'])

enter image description here



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.