Both phrases are grammatically correct but they differ in usage and meaning. When “endorsement of a medical society” is used, it means that the medical society is the recipient of the endorsement from some entity, as in this sentence: “Endorsement of a medical society by the government is subject to prior review by its duly designated health agency.” On the other hand, when “endorsement from a medical society” is used, it means that the medical society is the giver or source of the endorsement to some entity, as in this sentence: “An endorsement from a medical society is needed to authorize a doctor to participate in the international health conference.” An equivalent phrase that yields this “giver” or “source” sense is “endorsement by a medical society,” as in this alternative sentence construction to the preceding example: “An endorsement by a medical society is needed to authorize a doctor to participate in the international health conference.”