[SalesForce] Passing getParameter() to REST Callout Method

I'm successfully calling the GetRestID method in this controller on my VisualForce Page and see the correct response from the getParameters() method from my SOQL query. The problem is trying to pass 'RestID' to my GET method. I believe the callout is happening before getParameters() returns the ID value of the current Account page.

What is the correct way to pass the active Account ID to my GET method?

Controller:

public with sharing class extensionTest {

    private final Account acct;
    public String restID;
    public RSAPI.responseResource ConsoleWrapperList {get; set;}

    public extensionTest(ApexPages.StandardController controller) {

        this.acct = (Account)controller.getRecord();

    }


    public String getGetRestID (){


    restID = [Select someID from account where id = :System.currentPagereference().getParameters().get('Id')].someID;


    return restID;

    }


public wrapper.responseResource getperformCallout(){

HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();

Http http = new Http();
req.setEndpoint('https://blahblah/' + getGetRestID());

req.setMethod('GET');
req.setHeader('Authorization','da932512800');
res = http.send(req);

if(res.getStatusCode() == 200 && res.getBody() != null){

ConsoleWrapperList = (wrapper.responseResource)json.deserialize(res.getBody(),wrapper.responseResource.class); 

}


return ConsoleWrapperList;

}

}

Apex Page:

<apex:page standardController="Account" extensions="extensionTest">
{!GetRestID} //The value to pass to GET method
<apex:form >
<apex:pageBlock >
<apex:pageBlockTable value="{!performCallout}" var="wrap">
<apex:column value="{!wrap.someId}"/>
<apex:column value="{!wrap.someName}"/>
<apex:column value="{!wrap.someAmount}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

Best Answer

To anyone looking at this post, I solved my issue a different way.

The problem was that I was trying to pass the getParameters() id to my REST call on page load. getparameters() doesn't return in time without some Javascript manipulation such as setTimeout(). Instead, I made the user press a commandButton to make the callout. That way, getParameters() has the id to pass into the controllers method at the time of execution. Then appended the id to the end of the url.

Hope this makes sense to someone reading this.