✔ 最佳答案
It is correct, grammatically. But it is more like "I'm telling a joke" than "I was just joking."
I think 我只是在開玩笑 is much better.
(It's for traditional Chinese. I think there are some differences between simplified and traditional. 雖然一樣是中文,可是說法有點不同)
It can be used when someone take your words too seriously, and then you can say "我剛剛是開玩笑的(or 我剛剛只是在開玩笑),別太認真啦。"
We don't usually use 笑話 in this case.