Skip to content

[BUG] Getting 'Unprocessable Entity' #38

@FranciscoDadone

Description

@FranciscoDadone

Describe the bug
I get Unprocessable Entity when passing usertags to upload a clip. (From NodeJS)

To Reproduce

const FormData = require('form-data');

const formData = new FormData();
formData.append('sessionid', sessionid);
  formData.append('caption', caption);
  formData.append('url', url);
  formData.append(
    'usertags',
    `{"user": {"pk": "${userInfo.pk}", "username": "${userInfo.username}", "full_name": "${userInfo.full_name}", "profile_pic_url": "${userInfo.profile_pic_url}", "profile_pic_url_hd": "${userInfo.profile_pic_url_hd}", "stories": []}, "x": 0, "y": 0}`
  );

fetch(`${process.env.INSTAGRAPI_URL}/clip/upload/by_url`, {
    method: 'POST',
    headers: formData.getHeaders(),
    body: formData,
  })

Traceback
rcplanesglobalbot-webversion-instagrapi-1 | INFO: 172.23.0.3:44116 - "POST /clip/upload/by_url HTTP/1.1" 422 Unprocessable Entity

Expected behavior
Upload the clip with the user tagged in it.

Desktop (please complete the following information):

  • OS: Fedora 34
  • Python version 3.8-slim
  • instagrapi version 1.0.0 (as localhost:8000 says)

Additional context
If I remove

 formData.append(
    'usertags',
    `{"user": {"pk": "${userInfo.pk}", "username": "${userInfo.username}", "full_name": "${userInfo.full_name}", "profile_pic_url": "${userInfo.profile_pic_url}", "profile_pic_url_hd": "${userInfo.profile_pic_url_hd}", "stories": []}, "x": 0, "y": 0}`
  );

the clip uploads correctly but when I add the 'usertags' it gives me that error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions