What you are asking is commonly referred to as Oracles in the cryptoworld. Which is some way to interact with assets outside of the blockchain, the problem with that is that since what is happening is impossible to verify by the blockchain. It can however work the other way, that the server which whom you wanted to communicates instead communicates with the blockchain, and immutably and publicly commits to whatever your smart contract does.
The blockchain cannot really contain secrets, since they would be visible for everyone, however what can be done is to "encrypt" the input to a smart contract, and at a later stage send proof that can unlock or recreate that value on the chain and proving that the value you sent now that is readable to everyone is actually the input that would recreate the encrypted value from before.
A real world example of this would to put a playing card face down on a table, everyone can see that there has been a card placed on the table, but the value is not visible (it's a secret). Later someone flips the card over and the value is visible to everyone (reveal). If you can demonstrate that the flipped card is indeed the same card that was put on the table face down and has not been replaced by another card (this would be equivalent to the cryptographic proof). Everyone can agree that the cards value is valid, and can be used to determine the outcome of the card game.