403 forbidden error when trying to get more than 50 campaigns
So I am trying to get all the sent campaigns linked to my account using php. I have worked out getting the max of 50 per page. I recently added code to use the next_link and get all of them. I am not getting a forbidden 403 error. I have looked all over and found nothing helpful. Got any ideas?
Re: 403 forbidden error when trying to get more than 50 campaigns
After looking at your code, what's most likely happening is that because the next link isn't quite being set properly, it is interfering with how the API key is provided. This would in turn cause the API respond with a 403 error because it does not recognize the API key.
The best way to resolve this is to make a minor adjustment to how you're implementing the pagination. The correct method would be to assign params as follows:
$params = array('next' => $results->next);
If you're still having trouble after making this change, please let me know!
You can post a new message in the Community or find us on Twitter Mon-Fri 8am-8pm ET, Sat 10am-8pm ET, & Sun 10am-6pm ET. We've got real people waiting to help you out. Click below to start a conversation!