Why i am getting a not found error when i try to create a new file with octokitnet?

David Pinedo Solano

i am trying to do an application that upload a json file to my github this file is going to be used to know what have done the user in the application.

But i am stuck with the creation of the file, i have this function

public async void CrearCredenciales(string nombre, string clave)
        {
            cliente = new GitHubClient(new ProductHeaderValue(System.Diagnostics.Process.GetCurrentProcess().ProcessName));
            credenciales = new Credentials("token");
            var user = await this.cliente.User.Get("davidgmd");          
            var repositorio = cliente.Repository.Get("davidgmd", "Proyecto-de-fin-de-grado");

            // create file
            var createChangeSet = await cliente.Repository.Content.CreateFile(
                                            user.Login,
                                            "Proyecto-de-fin-de-grado",
                                            nombre + ".json",
                                            new CreateFileRequest("File creation",
                                                                  "Hello World!",
                                                                  "master"));

            var request = new SearchCodeRequest("Clave")
            {
                FileName = nombre + ".json"
            };
            var result = await this.cliente.Search.SearchCode(request);
            var cadena = user.Bio.ToString();
        }

when the application try to execute "createChangeSet" i get an exception "Octokit.NotFoundException: 'Not Found'"

when i press to get more details, says "Api:Error Message not found".

I have revised the token, the user is correct, the name of the repo is right too, the settings for the token are: enter image description here

And for user all marked user Update all user data read:user Read all user profile data user:email Access user email addresses (read-only) user:follow Follow and unfollow users

David Pinedo Solano

Finally i get what was wrong, i was creating a credential, but that credential hadn't been asigned to the client.

So for the application that client was anonymous and ofc couldn't create a file.

now i am going to try to put as message the json itself, but i suppose this question is finish.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Why am i getting a nullpointerexception when I try to setAdapter?

Why am I getting a Connection Error When Trying to Create a New SQL Server Database?

Why I am getting an error when trying to create an audience?

Why am I getting File not found error for ExifInterface with Android?

why am i getting this error when reading a .json file?

Why am i getting error when i try to assign string to istringstream object in visual studio in c++?

Why I am getting an error when i try to save form into quiz model with entity framework?

Why am I getting these error messages when I try to view media files on my Android device?

Why am I getting a Segmentation fault when I try to add a new node to my linked list?

Why am I getting exception as I try to read .DOCX file?

Why am I getting an error when I try to get a string from my table in a Jframe?

Why am I getting a java.lang.NullPointerException error when I try to switch activities in studio?

Why am I getting NULL when I try to initiate a connection?

Why am I getting an error when I try to print the contents of a file I am searching for?

I am getting following error when I try to add constraint

Why am I getting file not found exception?

Why am I getting a syntax error when trying to create a table?

Why am I getting this error when I try to type Text() or Image() in Button(action: {})?

Why am I getting an error when I try to create the Scoreboard object with an array?

Why am i getting this error when i try to add foreign keys on Invoice table?

Python/Terminal - Why am I getting this error message when I try to get user input

I am getting this error when i try to find a RecyclerView by id

Why am I getting an error when I try to use ngrok to create a http tunnel for my local host 5000 for Twilio?

Why I am getting package not found error?

Why am I getting an error message when I try to deploy my Gatsby website?

Why am I getting an error when I try to add a Primary Key?

Why am I getting an error when I try to get a response by id?

Why am i getting this error when i try to answer my own dns request?

Why I am getting error in listener when I try to implement it in swipeable block?

TOP Ranking

HotTag

Archive