Using http post to post a Facebook update from VBA

martmac
martmac used Ask the Experts™
on
Hi,

I have been using http post to interact with a text message service API from within VBA and it works really well. I am aware that Facebook updates can be updated using http post but am struggling to get this to work. It may well be that it is not possible to achieve, hence this post.

From the Graph API this appears to be the http post code

POST graph.facebook.com
  /{user-id}/feed?
    message={message}&
    access_token={access-token}

Open in new window


I have setup an app on Facebook and have all the access tokens etc

Below is a snippet of what I am using to make http post requests to the text service

    Set WinHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
    
    myURL = "https://api.txtlocal.com/send/?"
    postData = "apiKey=" + apiKey + "&message=" + message + "&numbers=" + numbers + "&sender=" + sender
    
    WinHttpReq.Open "POST", myURL, False
    WinHttpReq.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
    WinHttpReq.Send (postData)
    
    SendSMS_textlocal = WinHttpReq.responseText

Open in new window


What I am looking to do is if you like, modify what I am using here to use HTTP post to update Facebook.

I am probably barking up the wrong tree and it's not possible, but I thought it worth an ask?  My issue is how to format the request to make the call.

If anyone could help that would be fantastic and much appreciated.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
Apologies, I have been away from work sick, This was very helpful. Thanks
Martin LissOlder than dirt
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial