Pollitically speaking the boycott is used by people who are not comfortable with something in a certain area (economic, social, health, etc) or about an action. Gandhi, Luther King among others civils legends used the boycott to achieve the attention to the cause.
In Niger's case there's a big problem: the opposition used the boycott as an end itself and not as a tool. The problem with the elections began in the moment when the Electoral Commission didn't give any official result of the primary polls and given the candidate of the opposition, Hama Amadou made his campaign in jail, we could make the hypothesis that the Government used their influences to get arrested the candidate, so he wouldn't make any political propaganda during the elections; as soon as the electoral process is over, Amadou will be released of all charges.
The situation explained before, led the Opossition to take measure and the first one is the boycott; the information we have tell us that COPA (Opposition Coalition) was trying to get the attention of the international community and take over the results of the elections, withouth specify if they want a new election, the liberation of their candidate, the proclamation o their candidate, etc; even they had the attention, failed mostly because the African Union sent some international electoral observation mission and the didn't see any problem in the electoral process (boycot final objective); yes, it's true they had some logistical issues but that was expected to happen according to them.
And the other reason of why failed the boycott is because COPA didn't take the legal procedures to exhaust all the possibilities of fixing what they think is wrong. As Maikoul Zodi, member of the electoral commision said:
...If they notice that the figures announced do not correspond with those they hold, they know who to go to and they can even proceed to the election judge. I cannot confirm their accusations. But I would advise them to follow the procedure for such litigation and to respect the democratic process.
- African News.
- Al Jazeera.
- Wikipedia. Previously cited by the OP.