Unit test failing In module 1

Unit test failing, even though during logs during writing code says that my request was successfull, tried sending access token as a parameter as suggested from looking from previous post
by
data = {
‘url’: image_url,
‘published’ :‘true’,
‘message’: message
}
queryparam ={
‘access_token’: self.page_access_token
}
postlink = ‘https://graph.facebook.com/v7.0/’+self.page_id+’/photos
response = requests.post(postlink, data=data,params = queryparam)

Hi @aayushbansal213
Looks like you are facing challenges in the current module.

Below are a few similar topics raised by other users which you might find usefull

Note - This is a BETA Feature,if you find this helpful, kindly let us know.
Feedback link - https://forms.gle/cmxN5pdTXgnwgC986

Kindly mark this as a solution if this has helped you solve your query

Nope, not helping in my case

Can you put a screenshot of the log, where it shows the failing part? If that’s an access id error, then these developers should update the access tokens.

So First I was passing my access token with the data field itself, I printed my response status code and response both, it was 200 and could see the id and post id being generated, so I though, my API call is working when I pushed it for assessment, it failed.

After some searching through this forum, I read a comment by some crio team member(I can’t recall the post or comment exactly) it said that I should pass my access token as a parameter. so then I passed it as the parameter as shown in the topic I opened.
#For reference using this code
data = {
‘url’: image_url,
‘published’ :‘true’,
‘message’: message
}
queryparam ={
‘access_token’: self.page_access_token
}
postlink = ‘https://graph.facebook.com/v7.0/’+self.page_id+’/photos’
response = requests.post(postlink, data=data,params = queryparam)

then again, to test, I send the request and I got the status code as 200 and a id and post_id was generated in response. Again pushed the code Then again it failed and unit test log for this is

Let me know your thoughts regarding this, or actually how to do that

Hi
you seem to be getting the same error as seem in this post

hint- check your json format and make sure you hard code values

Hey, I checked and i didn’t changed anything, but the image :|, anyways it passes. I still don’t know what caused the error exaclty, because logically, I didn’t changed anything

Closing this topic as your issue has been resolved by the community. If not Kindly un-mark the accepted solution to re-open the topic or feel free to create a new topic and post a link to this topic as a reference.