This story can be found in the Prose Edda.

Once three Ęsir, Odhinn, Loki, and Hoenir had left Asgard and travelled throughout the world without any provisions. Coming to a valley they saw a herd of oxen so they took one and set about to cooking it. When they thought it was ready they removed it from the fire, but it was not cooked. They placed it back on the fire to cook longer but when they removed it a second time it was still uncooked. They began to discuss what could cause such a thing when they heard a voice up in an oak tree above them say that it was the cause. They looked up and saw a large eagle sitting in the tree. The eagle said 'If you agree to give me my fill of the ox, then your meat will get done.' The Ęsir agreed to this and the eagle sailed down from the tree and snatched up two of the thighs and both the shoulders of the ox.
Loki grew angry at this and he grabbed a great stick and drove it deep into the eagle's body. The eagle recoiled from the attack and flew up into the air with one end of the stick firmly in its back and Loki clinging to the other end. The eagle was flying just hight enough for Loki's feet to be dragging along the stones and bushed on the ground and he (Loki) thought his arms would be pulled from their sockets. He called out to the eagle asking for mercy but the eagle replied it would only release Loki if he would swear an oath to bring Idunn and her apples out of Asgard. Loki agreed and so was released and allowed to return to his companions.
Upon his return to Asgard, Loki went to Idunn and told her that during his journeys he had found some apples that were more golden and beautiful than hers. He suggested they take some of her apples and go compare them to the ones he had found. Idunn agreed and they set out from Asgard. It was then that the giant Thiazzi came in the form of an eagle and carried Idunn away.
The Ęsir were dismayed at the disappearance of Idunn for, without her apples, they would grow old and grey. They held an assembly and asked one another when Idunn had last been seen and Heimdall said he had last seen her leaving Asgard in the company of Loki. Loki was seized and brought before the assembly where he was made to tell of what he had done. The assembly threatened him with torture and death and he grew so frightened that he said he would journey to Jotunheim to retrieve Idunn if Freya would lend him her falcon coat.
When he had the falcon coat he used it to transform himself into a falcon and he flew to Jotunheim. He arrived at Thiazzi's home on a day when he had gone out rowing on the sea and Idunn was home alone. Loki changed her into the form of a nut and, holding her in his talons, flew off at top speed. When Thiazzi returned home and saw that Idunn was missing he took the shape of an eagle and flew after Loki with a tremendous rush of air in his wake. The Ęsir, seeing the falcon flying with the nut and the eagle in pursuit, went out to the walls of Asgard carrying bundles of plane shavings. When the falcon (Loki) reached Asgard he dropped down at the wall and the Ęsir set fire to the plane shavings. The eagle (Thiazzi) was unable to check his course and he flew through the flames causeing his feathers to catch fire. The eagle fell to the ground and the Ęsir gathered around and killed him inside the gates.
Idunn was thus returned to Asgard where she continues to distribute the golden apples that allow the Ęsir to maintain their youth.
This story, like Asgard's Wall and the Giant Builder and The Treasures of the Dwarves shows how Loki gets himself and the Ęsir into trouble only to get them back out again.