As St. John of Damascus was calling Islam and Muslims heretics or a heresy and he considered Muhammad () a false Prophet and his book (meaning the Quran) etc. a lie and made fun of him. I must assume that the story of the camel which was referred too is verse (7:40) which as far as I learnt from a Coptic Scholar is more or less word by word present in the Aramaic or Syriac original of the Bible:
Quran:
Indeed, those who deny Our verses and are arrogant toward them - the gates of Heaven will not be opened for them, nor will they enter Paradise until a camel enters into the eye of a needle. And thus do We recompense the criminals.
The Coptic scholar here pretends that the word Camel الجَمَل is a mistake and it should be الجُمَل which according him is something like a yarn of wool or rope.
Imam az-Zamakhsari in his tafsir al-Kashaf holds this opinion as we can conclude from the link provided by @Kilise:
As for the word jamal جَمَل occurring in this sentence, there is hardly any doubt that its translation, in this context, as "camel" is erroneous. As pointed out by Zamakhshari', Ibn 'Abbas used to read the word in the spelling jummal جُمَل, which signifies "a thick rope" or "a twisted cable"; and the same reading is attributed to 'Ali ibn Abi Talib (Taj al-'Arus ).
It is to be noted that there are also several other dialectical spellings of this word, namely, jumal جُمَل, juml جُمْل, jumul جُمُل and, finally, jamal جَمَل (as in the generally-accepted version of the Qur’an) - all of them signifying "a thick, twisted rope" (Jawhari), and all of them used in this sense by some of the Prophet's Companions or their immediate successors (tabi'un).
Ibn 'Abbas is also quoted by Zamakhshari (read here in Arabic) as having said that God could not have coined so inappropriate a metaphor as "a camel passing through a needle's eye"-meaning that there is no relationship whatsoever between a camel and a needle's eye whereas, on the other hand, there is a definite relationship between the latter and a rope (which, after all, is but an extremely thick thread).
The reading (jumal) of ibn 'Abbas can be found in almost all classical tafsir books such as at-Tabari, ibn Kathir, al-Qurtobi, ar-Razi ... If i remember well this mistake has already started according that Scholar when translating the Bible (read for example in Matthew 19-24). As both words have been looking the same in Aramaic/Syriac and the early Arabic.
Gospel of Matthew:
Then Jesus said to His disciples, “Truly I tell you, it is difficult for a rich man to enter the kingdom of heaven. Again I tell you, it is easier for a camel to pass through the eye of a needle than for a rich man to enter the kingdom of God.” When the disciples heard this they were greatly astonished and asked, “Who then can be saved?”…
According to Benachour in his tafsir this example was common and well known among Arabs: If somebody wanted to express that something is rather impossible he compared it with a Camel entering into the eye of a needle, as the Camel is the "biggest" animal among the livestock. Some Bible commentators say the same about Jews and say that the Persian equivalent was to put an elephant through the eye of a needle (see here).
To conclude: Muhammad () didn't write any book. The book St. John of Damascus is referring too is the Quran, as it was collected from pieces he might considered it as many different books or maybe he was referring to each surah being a book ... Beside the example of the Camel is present both in the Quran and the (Bible) new Testament (i didn't check it but my google search seem to indicate that it's not only present in the gospel of Matthew, but also in Luke's or Marks' or John's) even if the context is somewhat different. So maybe the intention of St. John was to show that Muhammad () was a plagiarist?