I ran an email program without campaign. When I try to fetch the activity "Email Send" (activity type id = 6) via rest api, it gives me a campaign id and campaign name. Now, when I try to find the particular campaign id via campaigns api, it says Campaign doesn't exist. How can I find the program associated with the activity?
If you sent it directly via email send to the list of records, the campaign ID comes for that temporary send action. You'll not be able to find it in Marketo.
You should be able to use the API to discover records which have this email send activity. Or you can create a smart list that says 'Was sent email', select the email you had sent, and the date when it was sent.