如何使用osticket API密钥

时间:2017-07-12 05:41:58

标签: php osticket

我已经从osticket(v.1.10)管理面板生成了一个API密钥并将我的IP设置为127.0.0.1,我已经下载了这个php脚本,但我不知道保存此文档的路径和URL应该是什么(是我的管理面板URL还是其他?)以及如何测试它?



public class AvatarLoader extends AsyncTask<String, Void, Bitmap> {

    private Context context;
    private ImageView view;
    private String userID;

    public AvatarLoader(Context context, ImageView view, String userID){
        this.view = view;
        this.userID = userID;
        this.context = context;
    }

    protected Bitmap doInBackground(String... urls){
        Bitmap image = null;
        String fileName = userID + ".png";
        try{
            InputStream inputStream = context.openFileInput(fileName);
            if (inputStream == null){
                URL url = new URL(urls[0]);
                InputStream inputStream = url.openStream();
                OutputStream outputStream = context.openFileOutput(fileName, Context.MODE_PRIVATE);
                while((int oneByte = inputStream.read()) != -1){
                    outputStream.write((byte)oneByte);
                }
                outputStream.close();
            }
            image = BitmapFactory.decodeStream(inputStream);
        }catch (Exception ex){
            Log.d("error", ex.toString());
        }
        return image;
    }

    protected void onPostExecute(Bitmap image){
        view.setImageBitmap(image);
    }
}
&#13;
&#13;
&#13;

提前致谢

1 个答案:

答案 0 :(得分:0)

事实证明我只需更改WHERE内的网址和密钥。如果您遇到与我License上的API测试新票证相同的问题,您只需将网址更改为$config=array()