Instructor: First of all,
this is not as hard as it seems.
So we're doing something with a card, right?
So it makes sense that we look here at the cards.
And as I mentioned, there is no move card endpoint.
It actually from a rest perspective,
doesn't really make sense to have such endpoints
like describing action
because what we are actually changing
are properties of a resource.
So where a card belongs is defined by ID list,
which is a property.
So in order to move the card from one list to the other,
what we actually need to change is the property ID list.
So we need to change something about the card.
So it makes sense in that case to use update a card.
But when we update a card, we now have a PUT request.
So with the PUT request,
we're changing something about that card.
In this case, the ID will say the same,
the name of the card will stay the same.
But what we wanna change is ID list.
So let's figure out a way how to do this.
Again, I'm gonna copy this endpoint.
Open up a new tab.
Start with the paste URL, paste the address itself.
Make sure to select PUT.
And here, I'm gonna go ahead and save this.
I'm gonna call it move card to DONE.
List.
Now we already know that this ID here
is a path parameter.
So instead of writing it with this notation,
I'm gonna write here column ID.
So Postman will display it in path variables here.
So what do we need?
Well, this is a mandatory parameter.
I don't even need to look at the API documentation to know
that this is the mandatory parameter
because what they're trying to do, update a card.
Well, which card?
Well, let's see. Which card? This card. Create a card.
This is the ID of the card.
So I wanna copy it.
And here I'm gonna have, here this ID.
We can simply go ahead and send this request as it is.
But we're gonna get an error here.
There's still a bit of information that we're missing.
Absolutely no problem.
We can simply copy that as well.
So the key and the token are missing not in path variables
but in query terms.
I'm gonna paste them here.
All right, let's try it again.
And we're getting 200.
Okay, right?
So essentially we haven't changed anything about
the card itself, right?
So if we're looking here,
what is the ID list?
We're gonna see here?
This is the value when we created the card.
And if we're looking here in the response itself,
we can search the response.
So you can either click here on this magnifier
and you can simply search here for something.
You will see here ID list.
So it still belongs to the same list
which is the to-do list.
So in order to change the list,
we need to change the property ID list.
So let's see if there's any information about
this property being accepted.
Because if the API doesn't accept this query parameter,
you can't really change anything about it, right?
So we'll see here that indeed ID list
does appear as a potential query param.
It's not mandatory, right?
Because we can change different things about our card.
We don't need to provide a lot of information,
only very little information.
So I'm gonna take here ID list as a query parameter.
I'm gonna specify it here
and now I wanna change something about it.
What do I wanna change?
Well, I wanna put it into the DONE list, all right?
So this is my DONE list.
Gonna copy the ID of the DONE list.
Go back to the PUT request and paste it here .
So now let's send this.
And if we're looking here in the response,
you're gonna see here this previous ID that we had
is no longer there.
If we're searching for the DONE list,
you will see now that we have changed the property.
So this card now is on the DONE list.
So this is how we have moved this card from one list
to the other by changing the ID list property.
This is the kind of technical thinking
I want you to start developing.
It's not about necessarily action that we wanna do
but technically speaking
about what are you trying to change about that resource?
How exactly are these resources tied together
and how does this ID thing work between them?