Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use upload.create command? #1

Open
prolic opened this issue Jan 24, 2017 · 0 comments
Open

How to use upload.create command? #1

prolic opened this issue Jan 24, 2017 · 0 comments

Comments

@prolic
Copy link

prolic commented Jan 24, 2017

I tried several things:

$response = $this->client->request('upload.create', [
     'project_id' => $this->projectId,
     'locale_id' => $localeId,
     'file' => $data, // xml string
     'file_format' => 'symfony_xliff',
     'tags' => $domain
]);

as well as:

$response = $this->client->request('upload.create', [
     'project_id' => $this->projectId,
     'locale_id' => $localeId,
     'file' => $fileName, // file name on disk
     'file_format' => 'symfony_xliff',
     'tags' => $domain
]);

and:

$response = $this->client->request('upload.create', [
     'project_id' => $this->projectId,
     'locale_id' => $localeId,
     'file' => '@' . $fileName, // file name on disk
     'file_format' => 'symfony_xliff',
     'tags' => $domain
]);

But I always receive the response:

Error executing command: Client error response [url] https://api.phraseapp.com/api/v2/projects/<my project id>/uploads [status code] 422 [reason phrase] status code 422

While doing it from linx with curl:

curl -u <my api key>: "https://api.phraseapp.com/api/v2/projects/<my project id>/uploads" -X POST -F file=@/tmp/booking_en.xlf -F file_format=symfony_xliff -F tags=booking -F locale_id=<my locale id>

works just fine, what am I doing wrong? Any help is greatly appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant