mgp 25 "Consent required"

1k Views Asked by At

I am getting an error in the mgp25 Instagram API. When I run the application on localhost, there is no problem, but when I get to the paid host, I get the following error.:

InstagramAPI\Response\TimelineFeedResponse: Consent required 

I had been working trouble free for 1-2 days but I noticed that it is not working. How can I solve this problem, is the problem with the proxy?

1

There are 1 best solutions below

1
On

This exception is related to GDPR consent. Is your host IP from the EU?

A GPDR consent request would look like this one:

public function sample()
{
    return $this->ig->request('consent/existing_user_flow/')
        ->addPost('_uuid', $this->ig->uuid)
        ->addPost('_uid', $this->ig->account_id)
        ->addPost('_csrftoken', $this->ig->client->getToken())
        ->addPost('current_screen_key', 'tos_and_two_age_button')
        ->addPost('updates', json_encode(['age_consent_state' => 2, 'tos_data_policy_consent_state' => 2]))
        ->getResponse(new Response\GenericResponse());
}

You can get more info here: https://github.com/mgp25/Instagram-API/pull/2047