Register for your free account! | Forgot your password?

You last visited: Today at 21:51

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Api Problem

Discussion on Api Problem within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1
 
NorseGodTyr's Avatar
 
elite*gold: 0
Join Date: May 2013
Posts: 2,223
Received Thanks: 1,483
Api Problem

Hey hab mal ne frage
arbeite mit nem kumpel am spiel namens icarus
und wir haben kleines problem mit der api also dem cash ingame
wird nicht angezeigt aber via postman bekommen wir nen result

Der worldserver fragt via url ab und dies haben wir via laragon

%s/inquiryBalance/json?makeCodeNo=%d&userNo=%d&userId=%s
----------------------------------------------------------------------------------------
Die api.php

Route:: post('inquiryBalance/json', 'Cash\CashShopController@inquiryBalance');
----------------------------------------------------------------------------------------
Die CashShopController.php

public function inquiryBalance(Request $request)
{
if(isset($request['userId'])){

$userID = $request['userId'];
$realBalance = 0;
$bonusBalance = 0;

$cashAccount = AccountInfo::where('Username', $userID)->first();
if($cashAccount){
$realBalance = $cashAccount->Real_Balance != null ? $cashAccount->Real_Balance : 0;
$bonusBalance = $cashAccount->Bonus_Balance != null ? $cashAccount->Bonus_Balance : 0;

return response()->json([
'result' => 'success',
'realCash' => intval($realBalance),
'bonusCash' => intval($bonusBalance)
],400);
}

}

return response()->json([
'service_code' => '',
'Result' => -97
],400);
}
----------------------------------------------------------------------------------------
Die AccountInfo.php

class AccountInfo extends Model
{
protected $connection = "Login";
protected $table = "AccountInfo";
protected $primaryKey = "AccountDBID";
protected $dates = [];
protected $fillable = ["Username", "Password", "UUID","RegisterTime", "RegisterIP",
"LastLoginTime","LastLoginIP","IsBlocked","Real_Ba lance","Bonus_Balance",
"Permission","UserAge","MakeCodeNo","Email","Real_ CERPass"

];

protected $hidden = [
'Password',
'UUID',
'Permission',
'MakeCodeNo'
];
----------------------------------------------------------------------------------------
NorseGodTyr is offline  
Old 03/20/2023, 22:15   #2
 
elite*gold: 0
Join Date: Apr 2011
Posts: 363
Received Thanks: 167
Quote:
Originally Posted by NorseGodTyr View Post
return response()->json([
'result' => 'success',
'realCash' => intval($realBalance),
'bonusCash' => intval($bonusBalance)
],400);
}
Don't know if you solved it or not but why are you returning a bad request status code in your json response
elmarcia is offline  
Old 03/26/2023, 14:17   #3
 
NorseGodTyr's Avatar
 
elite*gold: 0
Join Date: May 2013
Posts: 2,223
Received Thanks: 1,483
Quote:
Originally Posted by elmarcia View Post
Don't know if you solved it or not but why are you returning a bad request status code in your json response
Problem is solved
its only a copy of this api also not my work
NorseGodTyr is offline  
Reply


Similar Threads Similar Threads
Public War Rock Stats API / Öffentliche War Rock Stats API
10/16/2013 - WarRock - 11 Replies
Hallo, hier eine Kleinigkeit die ihr für euren Clan benutzen könnt: http://wa-sta.net/other/api/ Damit könnt ihr z.B. auf eurer Clanseite einbinden, ob eure Member online sind, die Statistiken von ihnen etc.
API Error Code: 100 API Error Description: Invalid parameter Error Message: redirect_
04/08/2012 - elite*gold Trading - 2 Replies
API Error Code: 100 API Error Description: Invalid parameter Error Message: redirect_uri URL is not properly formatted Das bekomme ich wenn ich ne App installiere... ich habe schon 3 Apps richtig installiert, danach kam immer das bei anderen Apps die ich installiert habe.. was heisst das? redirect_uri URL is not properly formatted
[GUIDE]Api Sheild to be against API Tools!
10/15/2011 - Metin2 PServer Guides & Strategies - 8 Replies
I got lot's of pm's from people asking me about api tool shield , so i decided to make a guide to show ya all how to get rid of the nowadays hackers in your servers ... First ... Open CONFIG of each channel , set pk_server:0 to pk_server:1 then in set adminpage_ip1 with adminpage_ip1: 192.168.2.(write yur real ip here) without quotes or space , just write it after the 192.168.2 directly like this .. example : adminpage_ip1: 192.168.2.ip And keep doing that for all CONFIG of all...
[ ALL IN ONE ] Lizenserver 7120 | API Server | API Tools
07/07/2011 - Metin2 PServer Guides & Strategies - 45 Replies
Hallo @all ServerAdmins! Hier möchte ich euch ein Projekt von mir vorstellen der vieles einfacher macht. Was ist das? Ein Arbeitsplatz für Administratoren von Mt2 Server. Was kann es? behebt das Problem socket_connect: HOST 220.95.239.40:7120, could not connect.
[HELP] Api tool v2 and other api's
05/28/2011 - Metin2 Private Server - 0 Replies
Hi, can someone tell me where i can find the api tool v2 fix? and if there are other types of API tools Thank you very much



All times are GMT +2. The time now is 21:52.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.