Q:

How to pull unique data with retrofit

I'm trying to pull some data from a retrofit API and it's JSON looks like this:
{  
   "data":{  
      "id":"1",
      "type": null,
      "links":{  
         "self":null
      },
      "attributes":{  
         "createdAt":null,
         "updatedAt":null,
         "slug":"teste",
         "synopsis":"text",

Then I try to get the specific data like this:
Model:
public class Data {

    private ArrayList<Movie> data;

    public ArrayList<Movie> getData() {
        return data;
    }

    public void setData(ArrayList<Animes> data) {
        this.data = data;
    }
}

public class Movie {

    private String id;
    private Attributes attributes;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Attributes getAttributes() {
        return attributes;
    }

    public void setAttributes(Attributes attributes) {
        this.attributes = attributes;
    }
}

ApiService:
@GET("movie/{id}")
Call<Data> obtainProfile(@Path("id") int id);

int id = getIntent().getIntExtra("ID", 0);
private void obtainData(final int id) {

        ApiService service = retrofit.create(ApiService.class);
        Call<Data> profileCall = service.obtainProfile(id);

        profileCall.enqueue(new Callback<Data>() {
            @Override
            public void onResponse(Call<Data> call, Response<Data> response) {

                if (response.isSuccessful()) {

                    Data data = response.body();
                    Movie Movie = data.getData().get(0);
                    Attributes attributes = movie.getAttributes();

                    textName.setText(attributes.getCanonicalTitle());

                } else {
                    Log.e("INFO", "onResponse" + response.errorBody());
                    Toast.makeText(PerfilActivity.this, "Error connecting to server.", Toast.LENGTH_LONG).show();
                }
            }

            @Override
            public void onFailure(Call<Data> call, Throwable t) {
                Log.e("INFO", "onErro" + t.getMessage());
            }
        });

    }

How can I solve this? I tried but I can not view the data.
Will I have to create a list for this?
How can I solve this? I tried but I can not view the data.
Will I have to create a list for this?

A:

Change your ArrayList<Movie> to just Movie.
Also create another class:
public class DataResponse {
    public Data data;
}

And change your Retrofit method to this:
@GET("movie/{id}")
Call<DataResponse> obtainProfile(@Path("id") int id);

